diff --git a/modules/fruix/packages/freebsd.scm b/modules/fruix/packages/freebsd.scm index 76c4465..e54c9dc 100644 --- a/modules/fruix/packages/freebsd.scm +++ b/modules/fruix/packages/freebsd.scm @@ -53,6 +53,11 @@ freebsd-zlib freebsd-sh freebsd-bash + freebsd-nodejs + freebsd-npm + freebsd-ripgrep + freebsd-tmux + freebsd-neovim freebsd-native-kernel freebsd-native-world freebsd-native-runtime @@ -97,6 +102,23 @@ (make-freebsd-package name version build-system inputs home-page synopsis description license install-plan)) +(define (path-directory path) + (let ((index (string-index-right path #\/))) + (if index + (substring path 0 index) + "."))) + +(define (file-install-plan source target) + `((file ,source ,target))) + +(define (shared-library-install-plan source target) + (let ((link-target (false-if-exception (readlink source)))) + (if link-target + (list `(file ,(string-append (path-directory source) "/" link-target) + ,(string-append (path-directory target) "/" link-target)) + `(file ,source ,target)) + (file-install-plan source target)))) + (define freebsd-release "15.0-STABLE") (define-record-type @@ -585,6 +607,133 @@ library for profile experiments." #:install-plan '((file "/lib/libz.so.6" "lib/libz.so.6")))) +(define freebsd-nodejs + (freebsd-package + #:name "freebsd-nodejs" + #:version "24.14.0_2" + #:build-system 'copy-build-system + #:inputs (list freebsd-libc freebsd-openssl freebsd-zlib) + #:home-page "https://nodejs.org/" + #:synopsis "Node.js runtime staged from FreeBSD packages" + #:description + "Host-staged Node.js package definition that copies the FreeBSD package +manager build into the Fruix store, including the shared libraries and +headers needed to run Node and build native modules." + #:license 'expat + #:install-plan + (append + '((file "/usr/local/bin/node" "bin/node") + (directory "/usr/local/include/node" "include/node") + (file "/usr/local/share/man/man1/node.1.gz" "share/man/man1/node.1.gz")) + (shared-library-install-plan "/usr/local/lib/libada.so.3" "lib/libada.so.3") + (shared-library-install-plan "/usr/local/lib/libbrotlicommon.so.1" "lib/libbrotlicommon.so.1") + (shared-library-install-plan "/usr/local/lib/libbrotlidec.so.1" "lib/libbrotlidec.so.1") + (shared-library-install-plan "/usr/local/lib/libbrotlienc.so.1" "lib/libbrotlienc.so.1") + (shared-library-install-plan "/usr/local/lib/libcares.so.2" "lib/libcares.so.2") + (shared-library-install-plan "/usr/local/lib/libgtest.so.1.16.0" "lib/libgtest.so.1.16.0") + (shared-library-install-plan "/usr/local/lib/libhdr_histogram.so.6" "lib/libhdr_histogram.so.6") + (shared-library-install-plan "/usr/local/lib/libicudata.so.76" "lib/libicudata.so.76") + (shared-library-install-plan "/usr/local/lib/libicui18n.so.76" "lib/libicui18n.so.76") + (shared-library-install-plan "/usr/local/lib/libicuuc.so.76" "lib/libicuuc.so.76") + (shared-library-install-plan "/usr/local/lib/libllhttp.so.9.3" "lib/libllhttp.so.9.3") + (shared-library-install-plan "/usr/local/lib/libmerve.so.1" "lib/libmerve.so.1") + (shared-library-install-plan "/usr/local/lib/libnbytes.so" "lib/libnbytes.so") + (shared-library-install-plan "/usr/local/lib/libnghttp2.so.14" "lib/libnghttp2.so.14") + (shared-library-install-plan "/usr/local/lib/libnghttp3.so.9" "lib/libnghttp3.so.9") + (shared-library-install-plan "/usr/local/lib/libngtcp2.so.16" "lib/libngtcp2.so.16") + (shared-library-install-plan "/usr/local/lib/libsimdjson.so.32" "lib/libsimdjson.so.32") + (shared-library-install-plan "/usr/local/lib/libsimdutf.so.33" "lib/libsimdutf.so.33") + (shared-library-install-plan "/usr/local/lib/libsqlite3.so.0" "lib/libsqlite3.so.0") + (shared-library-install-plan "/usr/local/lib/libuv.so.1" "lib/libuv.so.1") + (shared-library-install-plan "/usr/local/lib/libuvwasi.so" "lib/libuvwasi.so") + (shared-library-install-plan "/usr/local/lib/libzstd.so.1" "lib/libzstd.so.1")))) + +(define freebsd-npm + (freebsd-package + #:name "freebsd-npm" + #:version "11.11.0" + #:build-system 'copy-build-system + #:inputs (list freebsd-nodejs freebsd-bash) + #:home-page "https://www.npmjs.com/" + #:synopsis "npm CLI staged from FreeBSD packages" + #:description + "Host-staged npm package definition that copies the npm CLI, bundled +Node modules, and default configuration needed for local project installs and +npm exec workflows inside Fruix." + #:license 'artistic2.0 + #:install-plan + '((file "/usr/local/bin/npm" "bin/npm") + (file "/usr/local/bin/npx" "bin/npx") + (file "/usr/local/bin/node-gyp" "bin/node-gyp") + (file "/usr/local/etc/npmrc" "etc/npmrc") + (file "/usr/local/etc/man.d/npm.conf" "etc/man.d/npm.conf") + (directory "/usr/local/lib/node_modules/npm" "lib/node_modules/npm")))) + +(define freebsd-ripgrep + (freebsd-package + #:name "freebsd-ripgrep" + #:version "15.1.0_4" + #:build-system 'copy-build-system + #:inputs (list freebsd-libc) + #:home-page "https://github.com/BurntSushi/ripgrep" + #:synopsis "ripgrep staged from FreeBSD packages" + #:description + "Host-staged ripgrep package definition that copies the rg executable, +manual page, and PCRE2 shared library dependency into the Fruix store." + #:license 'expat + #:install-plan + (append + '((file "/usr/local/bin/rg" "bin/rg") + (file "/usr/local/share/man/man1/rg.1.gz" "share/man/man1/rg.1.gz")) + (shared-library-install-plan "/usr/local/lib/libpcre2-8.so.0" "lib/libpcre2-8.so.0")))) + +(define freebsd-tmux + (freebsd-package + #:name "freebsd-tmux" + #:version "3.6a" + #:build-system 'copy-build-system + #:inputs (list freebsd-libc) + #:home-page "https://github.com/tmux/tmux" + #:synopsis "tmux staged from FreeBSD packages" + #:description + "Host-staged tmux package definition that copies the tmux terminal +multiplexer, example configuration, manual page, and libevent dependency into +the Fruix store." + #:license 'isc + #:install-plan + (append + '((file "/usr/local/bin/tmux" "bin/tmux") + (file "/usr/local/share/examples/tmux/example_tmux.conf" + "share/examples/tmux/example_tmux.conf") + (file "/usr/local/share/man/man1/tmux.1.gz" "share/man/man1/tmux.1.gz")) + (shared-library-install-plan "/usr/local/lib/libevent_core-2.1.so.7" + "lib/libevent_core-2.1.so.7")))) + +(define freebsd-neovim + (freebsd-package + #:name "freebsd-neovim" + #:version "0.12.0" + #:build-system 'copy-build-system + #:inputs (list freebsd-libc) + #:home-page "https://neovim.io/" + #:synopsis "Neovim staged from FreeBSD packages" + #:description + "Host-staged Neovim package definition that copies the editor binary, +runtime files, parser modules, Lua modules, and shared libraries needed to run +Neovim from a Fruix profile." + #:license 'asl2.0 + #:install-plan + (append + '((file "/usr/local/bin/nvim" "bin/nvim") + (file "/usr/local/share/man/man1/nvim.1.gz" "share/man/man1/nvim.1.gz") + (directory "/usr/local/share/nvim" "share/nvim") + (directory "/usr/local/lib/nvim" "lib/nvim") + (file "/usr/local/lib/lua/5.1/lpeg.so" "lib/lua/5.1/lpeg.so")) + (shared-library-install-plan "/usr/local/lib/libintl.so.8" "lib/libintl.so.8") + (shared-library-install-plan "/usr/local/lib/libluv.so.1" "lib/libluv.so.1") + (shared-library-install-plan "/usr/local/lib/libutf8proc.so.3" "lib/libutf8proc.so.3") + (shared-library-install-plan "/usr/local/lib/libuv.so.1" "lib/libuv.so.1")))) + (define default-native-world-prune-paths '("usr/share/doc" "usr/share/examples" @@ -765,7 +914,12 @@ FreeBSD base input." freebsd-openssl freebsd-zlib freebsd-sh - freebsd-bash)) + freebsd-bash + freebsd-nodejs + freebsd-npm + freebsd-ripgrep + freebsd-tmux + freebsd-neovim)) (define %freebsd-host-staged-system-packages (list freebsd-kernel @@ -797,7 +951,9 @@ FreeBSD base input." (second-wave . (freebsd-runtime freebsd-libc freebsd-userland freebsd-rc-scripts)) (third-wave . (freebsd-networking freebsd-openssh)) (fourth-wave . (freebsd-kernel-headers freebsd-clang-toolchain)) - (fifth-wave . (freebsd-gmake freebsd-autotools freebsd-openssl freebsd-zlib freebsd-sh freebsd-bash)))) + (fifth-wave . (freebsd-gmake freebsd-autotools freebsd-openssl freebsd-zlib + freebsd-sh freebsd-bash freebsd-nodejs freebsd-npm + freebsd-ripgrep freebsd-tmux freebsd-neovim)))) (define (freebsd-native-system-packages-for base) (list (freebsd-native-runtime-for base))) diff --git a/modules/fruix/system/freebsd/render.scm b/modules/fruix/system/freebsd/render.scm index 5b54949..3ea6cf2 100644 --- a/modules/fruix/system/freebsd/render.scm +++ b/modules/fruix/system/freebsd/render.scm @@ -1093,6 +1093,11 @@ "export CFLAGS=\"-I$profile/usr/include\"\n" "export CXXFLAGS=\"-I$profile/usr/include\"\n" "export LDFLAGS=\"-L$profile/lib\"\n" + "export LD_LIBRARY_PATH=\"$profile/lib:$profile/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"\n" + "export MANPATH=\"$profile/share/man:$profile/usr/share/man${MANPATH:+:$MANPATH}\"\n" + "export NODE_PATH=\"$profile/lib/node_modules${NODE_PATH:+:$NODE_PATH}\"\n" + "export VIMRUNTIME=\"$profile/share/nvim/runtime\"\n" + "export LUA_CPATH=\"$profile/lib/lua/5.1/?.so${LUA_CPATH:+;$LUA_CPATH};;\"\n" "export MAKEFLAGS=\"-m $profile/usr/share/mk\"\n" "export PATH=\"/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$profile/bin:$profile/sbin:$profile/usr/bin:$profile/usr/sbin\"\n" "EOF\n")) @@ -1106,7 +1111,8 @@ " exit 1\n" "}\n" "cat <