diff --git a/flake.nix b/flake.nix index 5770570..a3405d3 100644 --- a/flake.nix +++ b/flake.nix @@ -155,7 +155,7 @@ ''; }; pure-c = pkgs.mkShell { - buildInputs = (with pkgs; [ inotify-tools ]) ++ (with self.packages.${system}; [ nvim-pager ]) ++ (with pkgs-unstable; [ gdb gcc ]); + buildInputs = (with pkgs; [ inotify-tools ]) ++ (with self.packages.${system}; [ nvim-pager ]) ++ (with pkgs-unstable; [ gdb gcc binutils ]); PAGER = "${self.packages.${system}.nvim-pager}/bin/pager"; shellHook = '' @@ -429,16 +429,29 @@ } { pname = "http"; inherit version; - src = prev.fetchFromGitHub { owner = "pramsey"; repo = "pgsql-http"; rev = "v${version}"; hash = "sha256-C8eqi0q1dnshUAZjIsZFwa5FTYc7vmATF3vv2CReWPM="; }; nativeBuildInputs = with prev; [pkg-config curl]; }; + src = prev.fetchFromGitHub { + owner = "pramsey"; + repo = "pgsql-http"; + rev = "v${version}"; + hash = "sha256-C8eqi0q1dnshUAZjIsZFwa5FTYc7vmATF3vv2CReWPM="; + }; + nativeBuildInputs = with prev; [pkg-config curl]; + }; buildHelExt = versionSuffix: let postgresql = prev."postgresql_${versionSuffix}"; + c-hectic = self.packages.${prev.system}.c-hectic; in buildPostgresqlExtension { inherit postgresql; } { - pname = "postgrect"; + pname = "hel"; version = "0.1"; src = ./package/c/hel; - nativeBuildInputs = (with prev; [pkg-config]) ++ [ self.packages.${prev.system}.c-hectic ]; + nativeBuildInputs = (with prev; [pkg-config]) ++ [ c-hectic ]; + dontShrinkRPath = true; + postFixup = '' + echo ">>> postFixup running..." + ${prev.patchelf}/bin/patchelf --set-rpath ${c-hectic}/lib $out/lib/hel.so + ''; preInstall = ''mkdir $out''; }; in { diff --git a/package/c/hectic/default.nix b/package/c/hectic/default.nix index 2c09e14..6969e41 100644 --- a/package/c/hectic/default.nix +++ b/package/c/hectic/default.nix @@ -22,6 +22,7 @@ stdenv.mkDerivation { cp target/libhectic.a $out/lib/ cp target/hectic.so $out/lib/ cp hectic.h $out/include/ + ln $out/lib/hectic.so $out/lib/libhectic.so # Create hectic-config script cat > $out/bin/hectic-config < #include #include -#include +#include "hectic.h" #include #ifdef PG_MODULE_MAGIC diff --git a/package/c/hel/hel.o b/package/c/hel/hel.o index c0f5d5b..bee6350 100644 Binary files a/package/c/hel/hel.o and b/package/c/hel/hel.o differ diff --git a/package/c/hel/hel.so b/package/c/hel/hel.so index 492d518..85f55e8 100755 Binary files a/package/c/hel/hel.so and b/package/c/hel/hel.so differ