fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / mi / microbin / package.nix
blob4a1012f0f0493c0db1b87b4b2a6e7104b621deca
2   darwin,
3   fetchFromGitHub,
4   fetchpatch,
5   lib,
6   oniguruma,
7   openssl,
8   pkg-config,
9   rustPlatform,
10   stdenv,
13 rustPlatform.buildRustPackage rec {
14   pname = "microbin";
15   version = "2.0.4";
17   src = fetchFromGitHub {
18     owner = "szabodanika";
19     repo = "microbin";
20     rev = "v${version}";
21     hash = "sha256-fsRpqSYDsuV0M6Xar2GVoyTgCPT39dcKJ6eW4YXCkQ0=";
22   };
24   cargoHash = "sha256-7GSgyh2aJ2f8pozoh/0Yxzbk8Wg3JYuqSy/34ywAc2s=";
26   patches = [
27     # Prefix some URLs with args.public_path_as_str() by PeterUpfold
28     # https://github.com/szabodanika/microbin/pull/194
29     # MicroBin returns wrong URLs on deployments with non-root URLs.
30     (fetchpatch {
31       name = "0001-fixup-explicit-urls.patch";
32       url = "https://github.com/szabodanika/microbin/compare/b8a0c5490d681550d982ad02d67a1aaa0897f503..df062134cbaf3fd0ebcb67af8453a4c66844cd13.patch";
33       hash = "sha256-h13FBuzu2O4AwdhRHF5EX5LaKyPeWJAcaV6SGTaYzTg=";
34     })
36     # Minor fixups by LuK1337
37     # https://github.com/szabodanika/microbin/pull/211
38     # Fixup styling, password protected and private pastas.
39     (fetchpatch {
40       name = "0002-minor-fixups.patch";
41       url = "https://github.com/szabodanika/microbin/compare/b8a0c5490d681550d982ad02d67a1aaa0897f503..3b0c025e9b6dc1ca69269541940bdb53032a048a.patch";
42       hash = "sha256-cZB/jx5d6F+C4xOn49TQ1at/Z4ov26efo9PTtWEdCHw=";
43     })
45     # Fix MICROBIN_ETERNAL_PASTA by SouthFox-D
46     # https://github.com/szabodanika/microbin/pull/215
47     # MICROBIN_ETERNAL_PASTA config doesn't work without this.
48     (fetchpatch {
49       name = "0003-fix-microbin-eternal-pasta.patch";
50       url = "https://github.com/szabodanika/microbin/compare/b8a0c5490d681550d982ad02d67a1aaa0897f503..c7c846c64344b8d51500aa9a4b2e9a92de8d09d8.patch";
51       hash = "sha256-gCio73Jt0F7YCFtQxtf6pPBDLNcyOAcfSsiyjLFzEzY=";
52     })
54     # Fix raw pastes returning 404 by GizmoTjaz
55     # https://github.com/szabodanika/microbin/pull/218
56     # Existing pastas return code 404 even when they exist.
57     (fetchpatch {
58       name = "0004-fix-raw-pastas-returning-404.patch";
59       url = "https://github.com/szabodanika/microbin/compare/b8a0c5490d681550d982ad02d67a1aaa0897f503..e789901520824d4bf610d28923097affe85ead7d.patch";
60       hash = "sha256-R47ozwu/FD1kCu5nx4Gf1cOFeLVFdS67K8RNDygwoZM=";
61     })
62   ];
64   nativeBuildInputs = [
65     pkg-config
66   ];
68   buildInputs =
69     [
70       oniguruma
71       openssl
72     ]
73     ++ lib.optionals stdenv.hostPlatform.isDarwin [
74       darwin.apple_sdk.frameworks.Security
75     ];
77   env = {
78     OPENSSL_NO_VENDOR = true;
79     RUSTONIG_SYSTEM_LIBONIG = true;
80   };
82   meta = with lib; {
83     description = "Tiny, self-contained, configurable paste bin and URL shortener written in Rust";
84     homepage = "https://github.com/szabodanika/microbin";
85     changelog = "https://github.com/szabodanika/microbin/releases/tag/v${version}";
86     license = licenses.bsd3;
87     maintainers = with maintainers; [
88       dit7ya
89       figsoda
90     ];
91     mainProgram = "microbin";
92   };