flatpak: build flatstart with depends

This commit is contained in:
tobtoht 2023-06-29 20:36:16 +02:00
parent 37a0132efe
commit efa56059f2
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
5 changed files with 21 additions and 37 deletions

View file

@ -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

View file

@ -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

View file

@ -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 .

View file

@ -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")

View file

@ -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)))