about summary refs log tree commit diff
path: root/pkgs/servers/microbin
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-07-11 14:41:17 -0400
committerfigsoda <figsoda@pm.me>2023-07-11 14:46:21 -0400
commitc8b160538e5d4a484d93fa43cc7ae8752c5ab45b (patch)
treed52cfe2331344bbbb16a163372e195d61008de83 /pkgs/servers/microbin
parentf2406198ea0e4e37d4380d0e20336c575b8f8ef9 (diff)
microbin: 1.2.1 -> 2.0.4
Diff: https://github.com/szabodanika/microbin/compare/v1.2.1...v2.0.4

Changelog: https://github.com/szabodanika/microbin/releases/tag/v2.0.4
Diffstat (limited to 'pkgs/servers/microbin')
-rw-r--r--pkgs/servers/microbin/default.nix36
1 files changed, 29 insertions, 7 deletions
diff --git a/pkgs/servers/microbin/default.nix b/pkgs/servers/microbin/default.nix
index d1048d107e2e3..3d75a7ff8c7cd 100644
--- a/pkgs/servers/microbin/default.nix
+++ b/pkgs/servers/microbin/default.nix
@@ -1,19 +1,41 @@
 { lib
 , rustPlatform
-, fetchCrate
+, fetchFromGitHub
+, pkg-config
+, oniguruma
+, openssl
+, stdenv
+, darwin
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "microbin";
-  version = "1.2.1";
+  version = "2.0.4";
 
-  # The GitHub source is outdated
-  src = fetchCrate {
-    inherit pname version;
-    hash = "sha256-OLg0ejs9nanMNlY0lcnJ/RoRwefrXEaaROwx5aPx4u8=";
+  src = fetchFromGitHub {
+    owner = "szabodanika";
+    repo = "microbin";
+    rev = "v${version}";
+    hash = "sha256-fsRpqSYDsuV0M6Xar2GVoyTgCPT39dcKJ6eW4YXCkQ0=";
   };
 
-  cargoHash = "sha256-XdHP0XruqtyLyGbLHielnmTAc3ZgeIyyZnknO+5k4Xo=";
+  cargoHash = "sha256-7GSgyh2aJ2f8pozoh/0Yxzbk8Wg3JYuqSy/34ywAc2s=";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    oniguruma
+    openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.Security
+  ];
+
+  env = {
+    OPENSSL_NO_VENDOR = true;
+    RUSTONIG_SYSTEM_LIBONIG = true;
+  };
 
   meta = with lib; {
     description = "A tiny, self-contained, configurable paste bin and URL shortener written in Rust";