From: tobtoht Date: Thu, 29 Jun 2023 18:36:16 +0000 (+0200) Subject: flatpak: build flatstart with depends X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=efa56059f2bbec9037146f1d52fec23800c6ce76;p=gamesguru%2Ffeather.git flatpak: build flatstart with depends --- diff --git a/contrib/depends/packages/flatstart.mk b/contrib/depends/packages/flatstart.mk new file mode 100644 index 00000000..592f41f8 --- /dev/null +++ b/contrib/depends/packages/flatstart.mk @@ -0,0 +1,14 @@ +package=flatstart +$(package)_version=a148fb86c30968eeb30dc6ac3384ad2a16690520 +$(package)_download_path=https://github.com/tobtoht/ln-guix-store/archive/ +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=e9694fcda4f9fcb00374da7a439b881296c0ce67ea98ca44bf2830d1a364365b + +define $(package)_build_cmds + zig build-exe ln-guix-store.zig --strip -OReleaseSmall +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_staging_prefix_dir)/bin && \ + cp ln-guix-store $($(package)_staging_prefix_dir)/bin/startup +endef diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index 0214305a..822e0de8 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -4,6 +4,8 @@ native_packages := native_libxcb native_xcb_proto native_libXau native_xproto na linux_packages := eudev libfuse libsquashfuse zstd appimage_runtime linux_native_packages = +x86_64_linux_packages := flatstart + darwin_packages := darwin_native_packages = darwin_sdk native_cctools native_libtapi diff --git a/contrib/flatpak/make_flatpak.sh b/contrib/flatpak/make_flatpak.sh index 258b32e2..e0d39a66 100644 --- a/contrib/flatpak/make_flatpak.sh +++ b/contrib/flatpak/make_flatpak.sh @@ -24,6 +24,9 @@ cp /feather/contrib/flatpak/metadata . mkdir files cd files +# Copy flatstart binary +cp /feather/contrib/depends/x86_64-linux-gnu/bin/startup . + # Copy feather binary cp /feather-bin feather @@ -40,7 +43,6 @@ GUIX_PROFILE=$(get_store_path "profile") GUIX_GLIBC=$(get_store_path "glibc") GUIX_FONTCONFIG=$(get_store_path "fontconfig") GUIX_GCC=$(get_store_path "gcc") -LN_GUIX_STORE="$(get_store_path "ln-guix-store")/bin/ln-guix-store" # Patch Feather binary patchelf --set-interpreter "/${GUIX_GLIBC}/lib/ld-linux-x86-64.so.2" feather @@ -74,13 +76,9 @@ rm -rf "${GUIX_GLIBC:?}/bin" ln -s "/run/host/fonts" share/fonts ln -s "/run/host/fonts-cache" share/fonts-cache ln -s "/${GUIX_PROFILE}/share/locale" share/locale -ln -s "/${GUIX_PROFILE}/share/dbus-1" share/dbus-1 ln -s "/${GUIX_PROFILE}/share/xml" share/xml # Setup profile symlink ln -s "/${GUIX_PROFILE}" profile -# Setup startup symlink -ln -s "/app/${LN_GUIX_STORE}" startup - chmod -R 555 . \ No newline at end of file diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index c1185af6..c90b00bd 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -36,6 +36,7 @@ (gnu packages tls) (gnu packages version-control) (gnu packages xorg) + (gnu packages zig) (guix build-system gnu) (guix build-system perl) (guix build-system python) @@ -325,6 +326,7 @@ chain for " target " development.")) cmake-minimal meson ninja + zig ;; Native GCC 10 toolchain gcc-toolchain-10 (list gcc-toolchain-10 "static") diff --git a/contrib/guix/pack.scm b/contrib/guix/pack.scm index 1bfbf790..6341b93d 100644 --- a/contrib/guix/pack.scm +++ b/contrib/guix/pack.scm @@ -2,43 +2,12 @@ (gnu packages) (gnu packages certs) (gnu packages fontutils) - (gnu packages zig) (guix build-system gnu) (guix download) ((guix licenses) #:prefix license:) (guix packages) (guix utils)) -(define-public ln-guix-store - (package - (name "ln-guix-store") - (version "a148fb86c30968eeb30dc6ac3384ad2a16690520") - (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/tobtoht/ln-guix-store/archive/" version ".tar.gz")) - (sha256 (base32 "0nrncjix2c18px2cm67acz7c15hji2dl6ynsfh1v1z7rlk6lysg9")))) - (build-system gnu-build-system) - (arguments - (list - #:make-flags - #~(list (string-append "PREFIX=" #$output) - (string-append "CC=" #$(cc-for-target))) - #:phases - #~(modify-phases %standard-phases - (delete 'configure) ; No configure script. - (add-before 'build 'pre-build - (lambda _ - (setenv "ZIG_GLOBAL_CACHE_DIR" - (mkdtemp "/tmp/zig-cache-XXXXXX")))) - (delete 'check)))) - (native-inputs - (list zig)) - (synopsis "Symlink /app/gnu to /gnu") - (description "Tiny program to symlink /app/gnu to /gnu inside a Flatpak") - (license license:bsd-3) - (home-page "https://featherwallet.org/"))) - (define utf8-locales (make-glibc-utf8-locales glibc @@ -49,5 +18,4 @@ (append (list nss-certs fontconfig - ln-guix-store utf8-locales))) \ No newline at end of file