Merge pull request #312290 from lucasew/20240516-fix-collision
collision: fix build, update
This commit is contained in:
@@ -4,34 +4,59 @@
|
|||||||
, crystal
|
, crystal
|
||||||
, wrapGAppsHook4
|
, wrapGAppsHook4
|
||||||
, desktopToDarwinBundle
|
, desktopToDarwinBundle
|
||||||
, gi-crystal
|
|
||||||
, gobject-introspection
|
, gobject-introspection
|
||||||
|
, gnome
|
||||||
|
, python3
|
||||||
, libadwaita
|
, libadwaita
|
||||||
, openssl
|
, openssl
|
||||||
, libxml2
|
, libxml2
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
, gitUpdater
|
||||||
|
, _experimental-update-script-combinators
|
||||||
|
, runCommand
|
||||||
|
, crystal2nix
|
||||||
|
, writeShellScript
|
||||||
}:
|
}:
|
||||||
|
|
||||||
crystal.buildCrystalPackage rec {
|
crystal.buildCrystalPackage rec {
|
||||||
pname = "Collision";
|
pname = "Collision";
|
||||||
version = "3.6.0";
|
version = "3.8.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "GeopJr";
|
owner = "GeopJr";
|
||||||
repo = "Collision";
|
repo = "Collision";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
hash = "sha256-Qxe4ILDdfYfxu95EvKRTvkAOgDIZDiLymBlZouBWn0M=";
|
hash = "sha256-Bo/u0UYM/N7tLqdCs2OU5pdj2s9LXPooSR1PCGk9dSc=";
|
||||||
};
|
};
|
||||||
patches = [ ./make.patch ];
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail 'gtk-update-icon-cache $(PREFIX)/share/icons/hicolor' 'true'
|
||||||
|
'';
|
||||||
|
|
||||||
shardsFile = ./shards.nix;
|
shardsFile = ./shards.nix;
|
||||||
|
copyShardDeps = true;
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
cd lib/gi-crystal && shards build -Dpreview_mt --release --no-debug
|
||||||
|
cd ../.. && mkdir bin/ && cp lib/gi-crystal/bin/gi-crystal bin/
|
||||||
|
'';
|
||||||
|
|
||||||
# Crystal compiler has a strange issue with OpenSSL. The project will not compile due to
|
# Crystal compiler has a strange issue with OpenSSL. The project will not compile due to
|
||||||
# main_module:(.text+0x6f0): undefined reference to `SSL_library_init'
|
# main_module:(.text+0x6f0): undefined reference to `SSL_library_init'
|
||||||
# There is an explanation for this https://danilafe.com/blog/crystal_nix_revisited/
|
# There is an explanation for this https://danilafe.com/blog/crystal_nix_revisited/
|
||||||
# Shortly, adding pkg-config to buildInputs along with openssl fixes the issue.
|
# Shortly, adding pkg-config to buildInputs along with openssl fixes the issue.
|
||||||
|
|
||||||
nativeBuildInputs = [ wrapGAppsHook4 pkg-config gobject-introspection gi-crystal ]
|
nativeBuildInputs = [ wrapGAppsHook4 pkg-config gobject-introspection ]
|
||||||
++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
|
++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
|
||||||
buildInputs = [ libadwaita openssl libxml2 ];
|
|
||||||
|
buildInputs = [
|
||||||
|
libadwaita
|
||||||
|
openssl
|
||||||
|
libxml2
|
||||||
|
gnome.nautilus-python
|
||||||
|
python3.pkgs.pygobject3
|
||||||
|
];
|
||||||
|
|
||||||
buildTargets = ["bindings" "build"];
|
buildTargets = ["bindings" "build"];
|
||||||
|
|
||||||
@@ -40,6 +65,22 @@ crystal.buildCrystalPackage rec {
|
|||||||
|
|
||||||
installTargets = ["desktop" "install"];
|
installTargets = ["desktop" "install"];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
install -Dm555 ./nautilus-extension/collision-extension.py -t $out/share/nautilus-python/extensions
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
updateScript = _experimental-update-script-combinators.sequence [
|
||||||
|
(gitUpdater { rev-prefix = "v"; })
|
||||||
|
(_experimental-update-script-combinators.copyAttrOutputToFile "collision.shardLock" ./shard.lock)
|
||||||
|
{ command = [ (writeShellScript "update-lock" "cd $1; ${lib.getExe crystal2nix}") ./. ]; supportedFeatures = [ "silent" ]; }
|
||||||
|
{ command = [ "rm" ./shard.lock ]; supportedFeatures = [ "silent" ]; }
|
||||||
|
];
|
||||||
|
shardLock = runCommand "shard.lock" { inherit src; } ''
|
||||||
|
cp $src/shard.lock $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Check hashes for your files";
|
description = "Check hashes for your files";
|
||||||
homepage = "https://github.com/GeopJr/Collision";
|
homepage = "https://github.com/GeopJr/Collision";
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
--- a/Makefile 2023-07-09 10:49:31.064190374 +0300
|
|
||||||
+++ b/Makefile 2023-07-19 11:19:37.415480179 +0300
|
|
||||||
@@ -6,7 +6,7 @@
|
|
||||||
all: desktop bindings build
|
|
||||||
|
|
||||||
bindings:
|
|
||||||
- ./bin/gi-crystal || $(CRYSTAL_LOCATION)shards install && ./bin/gi-crystal
|
|
||||||
+ gi-crystal
|
|
||||||
|
|
||||||
build:
|
|
||||||
COLLISION_LOCALE_LOCATION="$(PREFIX)$(LOCALE_LOCATION)" $(CRYSTAL_LOCATION)shards build -Dpreview_mt --release --no-debug
|
|
||||||
@@ -43,7 +43,7 @@
|
|
||||||
install -D -m 0644 data/dev.geopjr.Collision.desktop $(PREFIX)/share/applications/dev.geopjr.Collision.desktop
|
|
||||||
install -D -m 0644 data/icons/dev.geopjr.Collision.svg $(PREFIX)/share/icons/hicolor/scalable/apps/dev.geopjr.Collision.svg
|
|
||||||
install -D -m 0644 data/icons/dev.geopjr.Collision-symbolic.svg $(PREFIX)/share/icons/hicolor/symbolic/apps/dev.geopjr.Collision-symbolic.svg
|
|
||||||
- gtk-update-icon-cache $(PREFIX)/share/icons/hicolor
|
|
||||||
+ gtk4-update-icon-cache --ignore-theme-index $(PREFIX)/share/icons/hicolor
|
|
||||||
glib-compile-schemas $(PREFIX)/share/glib-2.0/schemas/
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
@@ -1,18 +1,23 @@
|
|||||||
{
|
{
|
||||||
|
blake3 = {
|
||||||
|
url = "https://github.com/geopjr/blake3.cr.git";
|
||||||
|
rev = "v1.3.0";
|
||||||
|
sha256 = "0pc3h7b5gfkmxlw708qaqjfzjvv5ig3iwxxainq6pwfhpff4a5wd";
|
||||||
|
};
|
||||||
gettext = {
|
gettext = {
|
||||||
url = "https://github.com/geopjr/gettext.cr.git";
|
url = "https://github.com/geopjr/gettext.cr.git";
|
||||||
rev = "v1.0.0";
|
rev = "v1.0.0";
|
||||||
sha256 = "1y27m4170rr4532j56grzhwbz8hj6z7j3zfkd0jnfwnsxclks1kc";
|
sha256 = "1y27m4170rr4532j56grzhwbz8hj6z7j3zfkd0jnfwnsxclks1kc";
|
||||||
};
|
};
|
||||||
gio = {
|
gi-crystal = {
|
||||||
url = "https://github.com/hugopl/gio.cr.git";
|
url = "https://github.com/hugopl/gi-crystal.git";
|
||||||
rev = "v0.1.0";
|
rev = "v0.22.2";
|
||||||
sha256 = "0vj35bi64d4hni18nrl8fmms306a0gl4zlxpf3aq08lh0sbwzhd8";
|
sha256 = "0bpa1f8iaf97z2kbgjc7nc8km7nd7bppiwna319lm2hvm8m5pw15";
|
||||||
};
|
};
|
||||||
gtk4 = {
|
gtk4 = {
|
||||||
url = "https://github.com/hugopl/gtk4.cr.git";
|
url = "https://github.com/hugopl/gtk4.cr.git";
|
||||||
rev = "v0.15.0";
|
rev = "v0.16.1";
|
||||||
sha256 = "100j5k4sfc2dpj3nplzjcaxw1bwy3hsy5cw93asg00kda9h8dbb1";
|
sha256 = "1cqkbh072y70l8g0p040vf50k920p32ry1larnwn9mqabd74jwaj";
|
||||||
};
|
};
|
||||||
harfbuzz = {
|
harfbuzz = {
|
||||||
url = "https://github.com/hugopl/harfbuzz.cr.git";
|
url = "https://github.com/hugopl/harfbuzz.cr.git";
|
||||||
@@ -26,12 +31,12 @@
|
|||||||
};
|
};
|
||||||
non-blocking-spawn = {
|
non-blocking-spawn = {
|
||||||
url = "https://github.com/geopjr/non-blocking-spawn.git";
|
url = "https://github.com/geopjr/non-blocking-spawn.git";
|
||||||
rev = "v1.0.5";
|
rev = "v1.1.0";
|
||||||
sha256 = "139gr87zlw0k9kf6pf9k2d88aa9x3kcnfg34qpbqrwsrck7708za";
|
sha256 = "1h43gskannylaai4dz2sjb6rds2h6slm1krg88inan12silhp66c";
|
||||||
};
|
};
|
||||||
pango = {
|
pango = {
|
||||||
url = "https://github.com/hugopl/pango.cr.git";
|
url = "https://github.com/hugopl/pango.cr.git";
|
||||||
rev = "v0.2.0";
|
rev = "v0.3.1";
|
||||||
sha256 = "0dl3qrhi2ybylmvzx1x5gsznp2pcdkc50waxrljxwnf5avn8ixsf";
|
sha256 = "0xlf127flimnll875mcq92q7xsi975rrgdpcpmnrwllhdhfx9qmv";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,17 @@
|
|||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, crystal
|
, crystal
|
||||||
, gobject-introspection
|
, gobject-introspection
|
||||||
|
, gitUpdater
|
||||||
}:
|
}:
|
||||||
crystal.buildCrystalPackage rec {
|
crystal.buildCrystalPackage rec {
|
||||||
pname = "gi-crystal";
|
pname = "gi-crystal";
|
||||||
version = "0.21.0";
|
version = "0.22.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "hugopl";
|
owner = "hugopl";
|
||||||
repo = "gi-crystal";
|
repo = "gi-crystal";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
hash = "sha256-hL+4MvJn1z9UKCtyvU4zzIxOwRyYQ3Qt4qRb5F0J+sg=";
|
hash = "sha256-JfBbKqobikpTGMryeO86zZ46EbOHybem+Cc5FZEL6i4=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Make sure gi-crystal picks up the name of the so or dylib and not the leading nix store path
|
# Make sure gi-crystal picks up the name of the so or dylib and not the leading nix store path
|
||||||
@@ -33,6 +34,11 @@ crystal.buildCrystalPackage rec {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
updateScript = gitUpdater { rev-prefix = "v"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "GI Crystal is a binding generator used to generate Crystal bindings for GObject based libraries using GObject Introspection.";
|
description = "GI Crystal is a binding generator used to generate Crystal bindings for GObject based libraries using GObject Introspection.";
|
||||||
homepage = "https://github.com/hugopl/gi-crystal";
|
homepage = "https://github.com/hugopl/gi-crystal";
|
||||||
|
|||||||
Reference in New Issue
Block a user