fractal-nixified: unstable-2023-09-14 (350a65cb0) -> 5 (2023-11-24)
this gets me the libadwaita/gtk4 updates from gnome 45.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,23 +1,18 @@
|
|||||||
{
|
{
|
||||||
"curve25519-dalek 4.0.0 (git+https://github.com/dalek-cryptography/curve25519-dalek/?rev=e44d4b5903106dde0e5b28a2580061de7dfe8a9f#e44d4b5903106dde0e5b28a2580061de7dfe8a9f)": "1lgkfr05m0f7ihdzb04yim609ihln3g5kqgppdwbnpvcm53ha4dk",
|
"mas-http 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw",
|
||||||
"curve25519-dalek-derive 0.1.0 (git+https://github.com/dalek-cryptography/curve25519-dalek/?rev=e44d4b5903106dde0e5b28a2580061de7dfe8a9f#e44d4b5903106dde0e5b28a2580061de7dfe8a9f)": "1lgkfr05m0f7ihdzb04yim609ihln3g5kqgppdwbnpvcm53ha4dk",
|
"mas-iana 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw",
|
||||||
"ed25519-dalek 2.0.0-rc.3 (git+https://github.com/dalek-cryptography/curve25519-dalek/?rev=e44d4b5903106dde0e5b28a2580061de7dfe8a9f#e44d4b5903106dde0e5b28a2580061de7dfe8a9f)": "1lgkfr05m0f7ihdzb04yim609ihln3g5kqgppdwbnpvcm53ha4dk",
|
"mas-jose 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw",
|
||||||
"matrix-sdk 0.6.2 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"mas-keystore 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw",
|
||||||
"matrix-sdk-base 0.6.1 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"mas-oidc-client 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw",
|
||||||
"matrix-sdk-common 0.6.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"mas-tower 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw",
|
||||||
"matrix-sdk-crypto 0.6.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"matrix-sdk 0.6.2 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"matrix-sdk-indexeddb 0.2.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"matrix-sdk-base 0.6.1 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"matrix-sdk-qrcode 0.4.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"matrix-sdk-common 0.6.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"matrix-sdk-sqlite 0.1.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"matrix-sdk-crypto 0.6.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"matrix-sdk-store-encryption 0.2.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"matrix-sdk-indexeddb 0.2.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"matrix-sdk-ui 0.6.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=4643bae28445e058080896a280083b32fd403146#4643bae28445e058080896a280083b32fd403146)": "0w92ibnmq2dvnr4h3l9bdi0plmywp4jka77nqab0xn1in4shlnh3",
|
"matrix-sdk-qrcode 0.4.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"ruma 0.8.2 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
"matrix-sdk-sqlite 0.1.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"ruma-client-api 0.16.2 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
"matrix-sdk-store-encryption 0.2.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"ruma-common 0.11.3 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
"matrix-sdk-ui 0.6.0 (git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=8895ce40d13faa79012144c97044990284215758#8895ce40d13faa79012144c97044990284215758)": "1s72nchfy860f9mk2a9l33wby1k3w93kvmviilrlys75pbpk9vjz",
|
||||||
"ruma-federation-api 0.7.1 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
"oauth2-types 0.5.0-rc.2 (git+https://github.com/matrix-org/matrix-authentication-service?rev=357481b52e6dc092178a16b8a7d86df036aac608#357481b52e6dc092178a16b8a7d86df036aac608)": "11l2iww7zbhjyskkw6rfrkzgwdi2c7hprw6hw2c48vjw8kjqhzsw"
|
||||||
"ruma-identifiers-validation 0.9.1 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
|
||||||
"ruma-macros 0.11.3 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
|
||||||
"ruma-push-gateway-api 0.7.1 (git+https://github.com/ruma/ruma.git?rev=f1772ae5bc1d849655498f51b0fec7b0ef10e339#f1772ae5bc1d849655498f51b0fec7b0ef10e339)": "1mry5rbj02cn7p8vc5r5g0kz1y311ja2q9a19nnhj6l503n948ch",
|
|
||||||
"vodozemac 0.4.0 (git+https://github.com/matrix-org/vodozemac/?rev=e3b658526f6f1dd0a9065c1c96346b796712c425#e3b658526f6f1dd0a9065c1c96346b796712c425)": "135y0r8imr5y321khdck8kqaadvb5k4lv55m41vmbz73sqkxc9jc",
|
|
||||||
"x25519-dalek 2.0.0-rc.3 (git+https://github.com/dalek-cryptography/curve25519-dalek/?rev=e44d4b5903106dde0e5b28a2580061de7dfe8a9f#e44d4b5903106dde0e5b28a2580061de7dfe8a9f)": "1lgkfr05m0f7ihdzb04yim609ihln3g5kqgppdwbnpvcm53ha4dk"
|
|
||||||
}
|
}
|
@@ -1,8 +1,19 @@
|
|||||||
# Cargo.nix and crate-hashes.json were created with:
|
# Cargo.nix and crate-hashes.json were created with:
|
||||||
|
# - `nix run '.#crate2nix' -- generate -f ~/ref/repos/gnome/fractal/Cargo.toml`
|
||||||
|
# or, for latest crate2nix:
|
||||||
# - `nix shell -f https://github.com/kolloch/crate2nix/tarball/master`
|
# - `nix shell -f https://github.com/kolloch/crate2nix/tarball/master`
|
||||||
# - `crate2nix generate -f ~/ref/repos/gnome/fractal/Cargo.toml`
|
# - `crate2nix generate -f ~/ref/repos/gnome/fractal/Cargo.toml`
|
||||||
# or, once 0.11 reaches nixpkgs:
|
#
|
||||||
# - `nix run '.#crate2nix' -- generate -f ~/ref/repos/gnome/fractal/Cargo.toml`
|
# note that serde_derive fails for cross compilation. pin to 1.0.171.
|
||||||
|
# - see: <https://discourse.nixos.org/t/errors-using-serde-derive-with-buildrustcrate/31398>
|
||||||
|
# - sounds like serde-derive did eventually remove the "precompiled" blobs
|
||||||
|
# - 1.0.183: fails
|
||||||
|
# - 1.0.192: seems to work?
|
||||||
|
#
|
||||||
|
# to update:
|
||||||
|
# - `git fetch` in `~/ref/repos/gnome/fractal/`
|
||||||
|
# - re-run that crate2nix step
|
||||||
|
# - update `src` rev to match the local checkout!
|
||||||
#
|
#
|
||||||
# then:
|
# then:
|
||||||
# - `sed -i 's/target."curve25519_dalek_backend"/target."curve25519_dalek_backend" or ""/g' Cargo.nix`
|
# - `sed -i 's/target."curve25519_dalek_backend"/target."curve25519_dalek_backend" or ""/g' Cargo.nix`
|
||||||
@@ -14,6 +25,7 @@
|
|||||||
, buildPackages
|
, buildPackages
|
||||||
, cargo
|
, cargo
|
||||||
, desktop-file-utils
|
, desktop-file-utils
|
||||||
|
, fetchFromGitHub
|
||||||
, gdk-pixbuf
|
, gdk-pixbuf
|
||||||
, glib
|
, glib
|
||||||
, gst_all_1
|
, gst_all_1
|
||||||
@@ -45,244 +57,324 @@ let
|
|||||||
# as of 2023/10/30:
|
# as of 2023/10/30:
|
||||||
# - opt-level=3: builds in 5min, 71M binary
|
# - opt-level=3: builds in 5min, 71M binary
|
||||||
optFlags = if optimize then "-C opt-level=3" else "-C opt-level=0";
|
optFlags = if optimize then "-C opt-level=3" else "-C opt-level=0";
|
||||||
cargoNix = import ./Cargo.nix {
|
|
||||||
inherit pkgs;
|
extraCrateOverrides = {
|
||||||
# release = false;
|
fractal = attrs: attrs // {
|
||||||
rootFeatures = [ ]; #< avoids --cfg feature="default", simplifying the rustc CLI so that i can pass it around easier
|
src = pkgs.fetchFromGitLab {
|
||||||
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
domain = "gitlab.gnome.org";
|
||||||
fractal = attrs: attrs // {
|
owner = "GNOME";
|
||||||
src = pkgs.fetchFromGitLab {
|
repo = "fractal";
|
||||||
domain = "gitlab.gnome.org";
|
rev = "5";
|
||||||
owner = "GNOME";
|
hash = "sha256-XHb8HjQ5PDL2sen6qUivDllvYEhKnp1vQynD2Lksi30=";
|
||||||
repo = "fractal";
|
# rev = "ba15c5b12a3cdb67b57d6a1ce7c4a2e6a15f8c88";
|
||||||
rev = "350a65cb0a221c70fc3e4746898036a345ab9ed8";
|
# hash = "sha256-BZC/otMPM4pf/VOhFkgRrq6yEquChL3I9QsQVpFMakQ=";
|
||||||
hash = "sha256-z6uURqMG5pT8rXZCv5IzTjXxtt/f4KUeCDSgk90aWdo=";
|
};
|
||||||
};
|
codegenUnits = 256; #< this does get plumbed, but doesn't seem to affect build speed
|
||||||
codegenUnits = 256; #< this does get plumbed, but doesn't seem to affect build speed
|
outputs = [ "out" ]; # default is "out" and "lib", but that somehow causes cycles
|
||||||
outputs = [ "out" ]; # default is "out" and "lib", but that somehow causes cycles
|
outputDev = [ "out" ];
|
||||||
outputDev = [ "out" ];
|
nativeBuildInputs = [
|
||||||
nativeBuildInputs = [
|
appstream-glib # optional, for validation
|
||||||
appstream-glib # optional, for validation
|
desktop-file-utils # for update-desktop-database
|
||||||
desktop-file-utils # for update-desktop-database
|
glib # for glib-compile-resources, gettext
|
||||||
glib # for glib-compile-resources, gettext
|
gtk4 # for gtk4-update-icon-cache
|
||||||
gtk4 # for gtk4-update-icon-cache
|
meson
|
||||||
meson
|
ninja
|
||||||
ninja
|
pkg-config
|
||||||
pkg-config
|
wrapGAppsHook4
|
||||||
wrapGAppsHook4
|
];
|
||||||
];
|
buildInputs = [
|
||||||
buildInputs = [
|
glib
|
||||||
glib
|
gst_all_1.gst-plugins-bad
|
||||||
gst_all_1.gst-plugins-bad
|
gst_all_1.gst-plugins-base
|
||||||
gst_all_1.gst-plugins-base
|
gst_all_1.gst-plugins-good
|
||||||
gst_all_1.gst-plugins-good
|
gst_all_1.gstreamer
|
||||||
gst_all_1.gstreamer
|
gtk4
|
||||||
gtk4
|
gtksourceview5
|
||||||
gtksourceview5
|
libadwaita
|
||||||
libadwaita
|
libshumate
|
||||||
libshumate
|
openssl
|
||||||
openssl
|
pipewire
|
||||||
pipewire
|
sqlite
|
||||||
sqlite
|
xdg-desktop-portal
|
||||||
xdg-desktop-portal
|
];
|
||||||
|
|
||||||
|
mesonFlags = let
|
||||||
|
# this gets meson to shutup about rustc not producing executables.
|
||||||
|
# kinda silly though, since we patch out the actual cargo (rustc) invocations.
|
||||||
|
crossFile = writeText "cross-file.conf" ''
|
||||||
|
[binaries]
|
||||||
|
rust = [ 'rustc', '--target', '${rust.toRustTargetSpec stdenv.hostPlatform}' ]
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||||
|
"--cross-file=${crossFile}"
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonFlags = let
|
# patch so meson will invoke our `crate2nix_cmd.sh` instead of cargo
|
||||||
# this gets meson to shutup about rustc not producing executables.
|
postPatch = ''
|
||||||
# kinda silly though, since we patch out the actual cargo (rustc) invocations.
|
substituteInPlace src/meson.build \
|
||||||
crossFile = writeText "cross-file.conf" ''
|
--replace 'cargo_options,' "" \
|
||||||
[binaries]
|
--replace "cargo, 'build'," "'bash', 'crate2nix_cmd.sh'," \
|
||||||
rust = [ 'rustc', '--target', '${rust.toRustTargetSpec stdenv.hostPlatform}' ]
|
--replace "'src' / rust_target" "'target/bin'"
|
||||||
'';
|
'';
|
||||||
in
|
postConfigure = ''
|
||||||
lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
# copied from <pkgs/development/tools/build-managers/meson/setup-hook.sh>
|
||||||
"--cross-file=${crossFile}"
|
mesonFlags="--prefix=$prefix $mesonFlags"
|
||||||
];
|
mesonFlags="\
|
||||||
|
--libdir=''${!outputLib}/lib --libexecdir=''${!outputLib}/libexec \
|
||||||
|
--bindir=''${!outputBin}/bin --sbindir=''${!outputBin}/sbin \
|
||||||
|
--includedir=''${!outputInclude}/include \
|
||||||
|
--mandir=''${!outputMan}/share/man --infodir=''${!outputInfo}/share/info \
|
||||||
|
--localedir=''${!outputLib}/share/locale \
|
||||||
|
-Dauto_features=''${mesonAutoFeatures:-enabled} \
|
||||||
|
-Dwrap_mode=''${mesonWrapMode:-nodownload} \
|
||||||
|
$mesonFlags"
|
||||||
|
|
||||||
# patch so meson will invoke our `crate2nix_cmd.sh` instead of cargo
|
mesonFlags="''${crossMesonFlags+$crossMesonFlags }--buildtype=''${mesonBuildType:-plain} $mesonFlags"
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace src/meson.build \
|
|
||||||
--replace 'cargo_options,' "" \
|
|
||||||
--replace "cargo, 'build'," "'bash', 'crate2nix_cmd.sh'," \
|
|
||||||
--replace "'src' / rust_target" "'target/bin'"
|
|
||||||
'';
|
|
||||||
postConfigure = ''
|
|
||||||
# copied from <pkgs/development/tools/build-managers/meson/setup-hook.sh>
|
|
||||||
mesonFlags="--prefix=$prefix $mesonFlags"
|
|
||||||
mesonFlags="\
|
|
||||||
--libdir=''${!outputLib}/lib --libexecdir=''${!outputLib}/libexec \
|
|
||||||
--bindir=''${!outputBin}/bin --sbindir=''${!outputBin}/sbin \
|
|
||||||
--includedir=''${!outputInclude}/include \
|
|
||||||
--mandir=''${!outputMan}/share/man --infodir=''${!outputInfo}/share/info \
|
|
||||||
--localedir=''${!outputLib}/share/locale \
|
|
||||||
-Dauto_features=''${mesonAutoFeatures:-enabled} \
|
|
||||||
-Dwrap_mode=''${mesonWrapMode:-nodownload} \
|
|
||||||
$mesonFlags"
|
|
||||||
|
|
||||||
mesonFlags="''${crossMesonFlags+$crossMesonFlags }--buildtype=''${mesonBuildType:-plain} $mesonFlags"
|
echo "meson flags: $mesonFlags ''${mesonFlagsArray[@]}"
|
||||||
|
|
||||||
echo "meson flags: $mesonFlags ''${mesonFlagsArray[@]}"
|
meson setup build $mesonFlags "''${mesonFlagsArray[@]}"
|
||||||
|
cd build
|
||||||
|
'';
|
||||||
|
preBuild = ''
|
||||||
|
build_bin() {
|
||||||
|
# build_bin is what buildRustCrate would use to invoke rustc, but we want to drive the build
|
||||||
|
# with meson instead. however, meson doesn't know how to plumb our rust dependencies into cargo,
|
||||||
|
# so we still need to use build_bin for just one portion of the build.
|
||||||
|
#
|
||||||
|
# so, this mocks out the original build_bin:
|
||||||
|
# - we patch upstream fractal to call our `crate2nix_cmd.sh` when it wants to compile the rust.
|
||||||
|
# - we don't actually invoke meson (ninja) at all here, but rather in the `installPhase`.
|
||||||
|
# if we invoked it here, the whole build would just get re-done in installPhase anyway.
|
||||||
|
#
|
||||||
|
# rustc invocation copied from <pkgs/build-support/rust/build-rust-crate/lib.sh>
|
||||||
|
crate_name_=fractal
|
||||||
|
main_file=../src/main.rs
|
||||||
|
fix_link="-C linker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
||||||
|
EXTRA_RUSTC_FLAGS="$EXTRA_RUSTC_FLAGS ${optFlags}"
|
||||||
|
cat >> crate2nix_cmd.sh <<EOF
|
||||||
|
set -x
|
||||||
|
rmdir target/bin
|
||||||
|
rmdir target
|
||||||
|
ln -s ../target .
|
||||||
|
rustc \
|
||||||
|
$fix_link \
|
||||||
|
--crate-name $crate_name_ \
|
||||||
|
$main_file \
|
||||||
|
--crate-type bin \
|
||||||
|
$BIN_RUSTC_OPTS \
|
||||||
|
--out-dir target/bin \
|
||||||
|
-L dependency=target/deps \
|
||||||
|
$LINK \
|
||||||
|
$EXTRA_LINK_ARGS \
|
||||||
|
$EXTRA_LINK_ARGS_BINS \
|
||||||
|
$EXTRA_LIB \
|
||||||
|
--cap-lints allow \
|
||||||
|
$BUILD_OUT_DIR \
|
||||||
|
$EXTRA_BUILD \
|
||||||
|
$EXTRA_FEATURES \
|
||||||
|
$EXTRA_RUSTC_FLAGS \
|
||||||
|
--color ''${colors}
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
meson setup build $mesonFlags "''${mesonFlagsArray[@]}"
|
installPhase = "ninjaInstallPhase";
|
||||||
cd build
|
};
|
||||||
'';
|
|
||||||
preBuild = ''
|
|
||||||
build_bin() {
|
|
||||||
# build_bin is what buildRustCrate would use to invoke rustc, but we want to drive the build
|
|
||||||
# with meson instead. however, meson doesn't know how to plumb our rust dependencies into cargo,
|
|
||||||
# so we still need to use build_bin for just one portion of the build.
|
|
||||||
#
|
|
||||||
# so, this mocks out the original build_bin:
|
|
||||||
# - we patch upstream fractal to call our `crate2nix_cmd.sh` when it wants to compile the rust.
|
|
||||||
# - we don't actually invoke meson (ninja) at all here, but rather in the `installPhase`.
|
|
||||||
# if we invoked it here, the whole build would just get re-done in installPhase anyway.
|
|
||||||
#
|
|
||||||
# rustc invocation copied from <pkgs/build-support/rust/build-rust-crate/lib.sh>
|
|
||||||
crate_name_=fractal
|
|
||||||
main_file=../src/main.rs
|
|
||||||
fix_link="-C linker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
|
||||||
EXTRA_RUSTC_FLAGS="$EXTRA_RUSTC_FLAGS ${optFlags}"
|
|
||||||
cat >> crate2nix_cmd.sh <<EOF
|
|
||||||
set -x
|
|
||||||
rmdir target/bin
|
|
||||||
rmdir target
|
|
||||||
ln -s ../target .
|
|
||||||
rustc \
|
|
||||||
$fix_link \
|
|
||||||
--crate-name $crate_name_ \
|
|
||||||
$main_file \
|
|
||||||
--crate-type bin \
|
|
||||||
$BIN_RUSTC_OPTS \
|
|
||||||
--out-dir target/bin \
|
|
||||||
-L dependency=target/deps \
|
|
||||||
$LINK \
|
|
||||||
$EXTRA_LINK_ARGS \
|
|
||||||
$EXTRA_LINK_ARGS_BINS \
|
|
||||||
$EXTRA_LIB \
|
|
||||||
--cap-lints allow \
|
|
||||||
$BUILD_OUT_DIR \
|
|
||||||
$EXTRA_BUILD \
|
|
||||||
$EXTRA_FEATURES \
|
|
||||||
$EXTRA_RUSTC_FLAGS \
|
|
||||||
--color ''${colors}
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = "ninjaInstallPhase";
|
# TODO: upstream these into `pkgs/build-support/rust/default-crate-overrides.nix`
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: upstream these into `pkgs/build-support/rust/default-crate-overrides.nix`
|
clang-sys = attrs: attrs // {
|
||||||
|
LIBCLANG_PATH = "${buildPackages.llvmPackages.libclang.lib}/lib";
|
||||||
|
};
|
||||||
|
gdk-pixbuf-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gdk-pixbuf ];
|
||||||
|
};
|
||||||
|
gdk4-wayland-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gtk4 ]; # depends on "gtk4_wayland"
|
||||||
|
};
|
||||||
|
gdk4-x11-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gtk4 ]; # depends on "gtk4_x11"
|
||||||
|
};
|
||||||
|
gio-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ glib ];
|
||||||
|
};
|
||||||
|
gobject-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ glib ];
|
||||||
|
};
|
||||||
|
gstreamer-audio-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gst_all_1.gst-plugins-base ];
|
||||||
|
};
|
||||||
|
gstreamer-base-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gst_all_1.gst-plugins-base ];
|
||||||
|
};
|
||||||
|
gstreamer-pbutils-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gst_all_1.gst-plugins-base ];
|
||||||
|
};
|
||||||
|
gstreamer-play-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [
|
||||||
|
gst_all_1.gst-plugins-bad
|
||||||
|
gst_all_1.gst-plugins-base
|
||||||
|
];
|
||||||
|
};
|
||||||
|
gstreamer-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gst_all_1.gst-plugins-base ];
|
||||||
|
};
|
||||||
|
gstreamer-video-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gst_all_1.gst-plugins-base ];
|
||||||
|
};
|
||||||
|
gst-plugin-gtk4 = attrs: attrs // {
|
||||||
|
# [package.metadata.capi.pkg_config]
|
||||||
|
# requires_private = "gstreamer-1.0, gstreamer-base-1.0, gstreamer-video-1.0, gtk4, gobject-2.0, glib-2.0, gmodule-2.0"
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [
|
||||||
|
gst_all_1.gst-plugins-base
|
||||||
|
gst_all_1.gst-libav
|
||||||
|
gtk4
|
||||||
|
glib
|
||||||
|
];
|
||||||
|
CARGO_PKG_REPOSITORY = "nixpkgs";
|
||||||
|
# it wants `type = [ "cdylib" "rlib" ]` but that causes a link format failure on cross compilation
|
||||||
|
# (tries to link aarch64 gstgtk4.o file with the x86_64 linker).
|
||||||
|
# default if unspecified it `type = [ "lib" ]`
|
||||||
|
type = [ "rlib" ];
|
||||||
|
};
|
||||||
|
libadwaita-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ libadwaita ];
|
||||||
|
};
|
||||||
|
libshumate-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ libshumate gtk4 ];
|
||||||
|
};
|
||||||
|
libspa-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
|
||||||
|
buildInputs = [ pipewire ];
|
||||||
|
|
||||||
clang-sys = attrs: attrs // {
|
# bindgenHook does the equivalent of this:
|
||||||
LIBCLANG_PATH = "${buildPackages.llvmPackages.libclang.lib}/lib";
|
# preConfigure = (attrs.preConfigure or "") + ''
|
||||||
};
|
# # export BINDGEN_EXTRA_CLANG_ARGS="$NIX_CFLAGS_COMPILE"
|
||||||
gdk-pixbuf-sys = attrs: attrs // {
|
# export BINDGEN_EXTRA_CLANG_ARGS="$(< ${clang}/nix-support/cc-cflags) $(< ${clang}/nix-support/libc-cflags) $(< ${clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# '';
|
||||||
buildInputs = [ gdk-pixbuf ];
|
# LIBCLANG_PATH = "${buildPackages.llvmPackages.libclang.lib}/lib";
|
||||||
};
|
};
|
||||||
gdk4-wayland-sys = attrs: attrs // {
|
libspa = attrs: attrs // {
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# not sure why the non-sys version of this crate needs pkg-config??
|
||||||
buildInputs = [ gtk4 ]; # depends on "gtk4_wayland"
|
nativeBuildInputs = [ pkg-config ];
|
||||||
};
|
buildInputs = [ pipewire ];
|
||||||
gdk4-x11-sys = attrs: attrs // {
|
};
|
||||||
nativeBuildInputs = [ pkg-config ];
|
matrix-sdk-crypto = attrs: attrs // {
|
||||||
buildInputs = [ gtk4 ]; # depends on "gtk4_x11"
|
# src = fetchFromGitHub {
|
||||||
};
|
# owner = "matrix-org";
|
||||||
gio-sys = attrs: attrs // {
|
# repo = "matrix-rust-sdk";
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# # rev = "matrix-sdk-crypto-0.6.0"; # 2022-09-28. "use of undeclared crate or module `event_listener`"
|
||||||
buildInputs = [ glib ];
|
# # hash = "sha256-ozWzXrT+8U2BoJ/KDsRK+RIYpZTleXOw9U+KylRrnnE=";
|
||||||
};
|
# # rev = "ceeb5e78b6de782726c50c973a8dbbd46f9b2904"; # main
|
||||||
gobject-sys = attrs: attrs // {
|
# # hash = "sha256-nq0pd/q8T92t7HKV+NzZwleeFWz6tAh9wuuDcf1y+Y8=";
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# # rev = "894f4c218dba51f39c5393e624bbc763f0ff97cb"; # 2023-11-20
|
||||||
buildInputs = [ glib ];
|
# # hash = "sha256-v1i0fm3E4a/tU+xLjs5qVVOJk696l+OMdDJ0P95XBhM=";
|
||||||
};
|
# # rev = "8895ce40d13faa79012144c97044990284215758"; # 2023-11-07; tagged by fractal
|
||||||
gstreamer-audio-sys = attrs: attrs // {
|
# rev = "4643bae28445e058080896a280083b32fd403146"; # old pin. "use of undeclared crate or module `base64`"
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# hash = "sha256-A1oKNbEx2A6WwvYcNSW53Fd6QWwr0QFJtrsJXO2KInE=";
|
||||||
buildInputs = [ gst_all_1.gst-plugins-base ];
|
# };
|
||||||
};
|
# src = pkgs.fetchgit {
|
||||||
gstreamer-base-sys = attrs: attrs // {
|
# url = "https://github.com/matrix-org/matrix-rust-sdk.git";
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# rev = "4643bae28445e058080896a280083b32fd403146"; # old pin. "use of undeclared crate or module `base64`"
|
||||||
buildInputs = [ gst_all_1.gst-plugins-base ];
|
# hash = "sha256-A1oKNbEx2A6WwvYcNSW53Fd6QWwr0QFJtrsJXO2KInE=";
|
||||||
};
|
# };
|
||||||
gstreamer-pbutils-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ gst_all_1.gst-plugins-base ];
|
|
||||||
};
|
|
||||||
gstreamer-play-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [
|
|
||||||
gst_all_1.gst-plugins-bad
|
|
||||||
gst_all_1.gst-plugins-base
|
|
||||||
];
|
|
||||||
};
|
|
||||||
gstreamer-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ gst_all_1.gst-plugins-base ];
|
|
||||||
};
|
|
||||||
gstreamer-video-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ gst_all_1.gst-plugins-base ];
|
|
||||||
};
|
|
||||||
gst-plugin-gtk4 = attrs: attrs // {
|
|
||||||
# [package.metadata.capi.pkg_config]
|
|
||||||
# requires_private = "gstreamer-1.0, gstreamer-base-1.0, gstreamer-video-1.0, gtk4, gobject-2.0, glib-2.0, gmodule-2.0"
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [
|
|
||||||
gst_all_1.gst-plugins-base
|
|
||||||
gst_all_1.gst-libav
|
|
||||||
gtk4
|
|
||||||
glib
|
|
||||||
];
|
|
||||||
CARGO_PKG_REPOSITORY = "nixpkgs";
|
|
||||||
# it wants `type = [ "cdylib" "rlib" ]` but that causes a link format failure on cross compilation
|
|
||||||
# (tries to link aarch64 gstgtk4.o file with the x86_64 linker).
|
|
||||||
# default if unspecified it `type = [ "lib" ]`
|
|
||||||
type = [ "rlib" ];
|
|
||||||
};
|
|
||||||
libadwaita-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ libadwaita ];
|
|
||||||
};
|
|
||||||
libshumate-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ libshumate gtk4 ];
|
|
||||||
};
|
|
||||||
libspa-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
|
|
||||||
buildInputs = [ pipewire ];
|
|
||||||
|
|
||||||
# bindgenHook does the equivalent of this:
|
# features = attrs.features ++ [ "ruma-common" ];
|
||||||
# preConfigure = (attrs.preConfigure or "") + ''
|
# buildInputs = [ cargoNix.workspaceMembers.ruma-common.build ];
|
||||||
# # export BINDGEN_EXTRA_CLANG_ARGS="$NIX_CFLAGS_COMPILE"
|
# buildInputs = [
|
||||||
# export BINDGEN_EXTRA_CLANG_ARGS="$(< ${clang}/nix-support/cc-cflags) $(< ${clang}/nix-support/libc-cflags) $(< ${clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
|
# (cargoNix.internal.buildRustCrateWithFeatures {
|
||||||
# '';
|
# packageId = "ruma-common";
|
||||||
# LIBCLANG_PATH = "${buildPackages.llvmPackages.libclang.lib}/lib";
|
# features = [ "default" ];
|
||||||
};
|
# })
|
||||||
libspa = attrs: attrs // {
|
# ];
|
||||||
# not sure why the non-sys version of this crate needs pkg-config??
|
};
|
||||||
nativeBuildInputs = [ pkg-config ];
|
pipewire-sys = attrs: attrs // {
|
||||||
buildInputs = [ pipewire ];
|
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
|
||||||
};
|
buildInputs = [ pipewire ];
|
||||||
pipewire-sys = attrs: attrs // {
|
|
||||||
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
|
|
||||||
buildInputs = [ pipewire ];
|
|
||||||
|
|
||||||
# bindgenHook does the equivalent of this:
|
# bindgenHook does the equivalent of this:
|
||||||
# preConfigure = (attrs.preConfigure or "") + ''
|
# preConfigure = (attrs.preConfigure or "") + ''
|
||||||
# # export BINDGEN_EXTRA_CLANG_ARGS="$NIX_CFLAGS_COMPILE"
|
# # export BINDGEN_EXTRA_CLANG_ARGS="$NIX_CFLAGS_COMPILE"
|
||||||
# export BINDGEN_EXTRA_CLANG_ARGS="$(< ${clang}/nix-support/cc-cflags) $(< ${clang}/nix-support/libc-cflags) $(< ${clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
|
# export BINDGEN_EXTRA_CLANG_ARGS="$(< ${clang}/nix-support/cc-cflags) $(< ${clang}/nix-support/libc-cflags) $(< ${clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
|
||||||
# '';
|
# '';
|
||||||
# LIBCLANG_PATH = "${buildPackages.llvmPackages.libclang.lib}/lib";
|
# LIBCLANG_PATH = "${buildPackages.llvmPackages.libclang.lib}/lib";
|
||||||
};
|
};
|
||||||
sourceview5-sys = attrs: attrs // {
|
ring = attrs: attrs // {
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# CARGO_MANIFEST_LINKS = "ring_core_0_17_5";
|
||||||
buildInputs = [ gtksourceview5 ];
|
postPatch = (attrs.postPatch or "") + ''
|
||||||
};
|
substituteInPlace build.rs --replace \
|
||||||
|
'links = std::env::var("CARGO_MANIFEST_LINKS").unwrap();' 'links = "ring_core_0_17_5".to_string();'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
sourceview5-sys = attrs: attrs // {
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [ gtksourceview5 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
defaultCrateOverrides = pkgs.defaultCrateOverrides // extraCrateOverrides;
|
||||||
|
|
||||||
|
crate2NixOverrides = crates: crates // {
|
||||||
|
# crate2nix sometimes "misses" dependencies, or gets them wrong in a way that crateOverrides can't patch.
|
||||||
|
# this function lets me patch over Cargo.nix without actually modifying it by hand.
|
||||||
|
matrix-sdk-base = crates.matrix-sdk-base // {
|
||||||
|
dependencies = crates.matrix-sdk-base.dependencies ++ [
|
||||||
|
{
|
||||||
|
name = "ruma-events";
|
||||||
|
packageId = "ruma-events";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
matrix-sdk-crypto = crates.matrix-sdk-crypto // {
|
||||||
|
dependencies = crates.matrix-sdk-crypto.dependencies ++ [
|
||||||
|
{
|
||||||
|
name = "ruma-common";
|
||||||
|
packageId = "ruma-common";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoNix = import ./Cargo.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
release = false;
|
||||||
|
rootFeatures = [ ]; #< avoids --cfg feature="default", simplifying the rustc CLI so that i can pass it around easier
|
||||||
|
inherit defaultCrateOverrides;
|
||||||
|
};
|
||||||
|
|
||||||
|
# fractalDefault = cargoNix.workspaceMembers.fractal.build;
|
||||||
|
builtCrates = cargoNix.internal.builtRustCratesWithFeatures {
|
||||||
|
packageId = "fractal";
|
||||||
|
features = [];
|
||||||
|
buildRustCrateForPkgsFunc = pkgs: crateArgs: (pkgs.buildRustCrate.override {
|
||||||
|
inherit defaultCrateOverrides;
|
||||||
|
}) (crateArgs // {
|
||||||
|
# this can be used to force a rebuild of every crate
|
||||||
|
# mostly useful to deal with impurities (i.e. binfmt when cross-compiling)
|
||||||
|
FRACTAL_BUILD_VERSION = 1;
|
||||||
|
});
|
||||||
|
crateConfigs = crate2NixOverrides cargoNix.internal.crates;
|
||||||
|
runTests = false;
|
||||||
|
};
|
||||||
|
fractalDefault = builtCrates.crates.fractal;
|
||||||
in
|
in
|
||||||
cargoNix.workspaceMembers.fractal.build.overrideAttrs (super: {
|
fractalDefault.overrideAttrs (super: {
|
||||||
passthru = (super.passthru or {}) // {
|
passthru = (super.passthru or {}) // {
|
||||||
optimized = mkConfigured { optimize = true; };
|
optimized = mkConfigured { optimize = true; };
|
||||||
unoptimized = mkConfigured { optimize = false; };
|
unoptimized = mkConfigured { optimize = false; };
|
||||||
|
Reference in New Issue
Block a user