wip
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
diff --git a/asahi_firmware/update.py b/asahi_firmware/update.py
|
||||
index 8d4c480..7d89353 100644
|
||||
--- a/asahi_firmware/update.py
|
||||
+++ b/asahi_firmware/update.py
|
||||
@@ -30,7 +30,7 @@ def update_firmware(source, dest, manifest):
|
||||
|
||||
pkg.save_manifest(manifest)
|
||||
|
||||
-if __name__ == "__main__":
|
||||
+def main():
|
||||
import argparse
|
||||
import logging
|
||||
logging.basicConfig()
|
||||
@@ -46,3 +46,7 @@ if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
|
||||
update_firmware(args.source, args.dest, args.manifest)
|
||||
+
|
||||
+if __name__ == "__main__":
|
||||
+ main()
|
||||
+
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 45ada19..1b371ba 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -9,4 +9,5 @@ setup(name='asahi_firmware',
|
||||
author_email='marcan@marcan.st',
|
||||
url='https://github.com/AsahiLinux/asahi-installer/',
|
||||
packages=['asahi_firmware'],
|
||||
+ entry_points={"console_scripts": ["asahi-fwextract = asahi_firmware.update:main"]}
|
||||
)
|
||||
@@ -1,24 +1,29 @@
|
||||
{ lib
|
||||
, python3
|
||||
, python3Packages
|
||||
, fetchFromGitHub
|
||||
, makeBinaryWrapper
|
||||
, gzip
|
||||
, gnutar
|
||||
, lzfse
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "asahi-fwextract";
|
||||
version = "0.4pre2";
|
||||
version = "0.5pre10";
|
||||
|
||||
# tracking version: https://github.com/AsahiLinux/PKGBUILDs/blob/main/asahi-fwextract/PKGBUILD
|
||||
src = fetchFromGitHub {
|
||||
owner = "AsahiLinux";
|
||||
repo = "asahi-installer";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-RqvD2hNjKMlUg+oY1woUN5zpN+1Y/TrBQbokNgdeCW4=";
|
||||
hash = "sha256-93dTRrNNo7yilSGpSNjXir+DhQe29DeoZHXusrk9PN8=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./add_entry_point.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ python3.pkgs.setuptools makeBinaryWrapper ];
|
||||
}
|
||||
postPatch = ''
|
||||
substituteInPlace asahi_firmware/img4.py \
|
||||
--replace 'liblzfse.so' '${lzfse}/lib/liblzfse.so'
|
||||
substituteInPlace asahi_firmware/update.py \
|
||||
--replace '"tar"' '"${gnutar}/bin/tar"' \
|
||||
--replace '"xf"' '"-x", "-I", "${gzip}/bin/gzip", "-f"'
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user