nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rustPlatform,
6 meson,
7 ninja,
8 pkg-config,
9 rustc,
10 cargo,
11 wrapGAppsHook4,
12 desktop-file-utils,
13 libadwaita,
14 openssl,
15 nix-update-script,
16}:
17
18stdenv.mkDerivation (finalAttrs: {
19 pname = "share-preview";
20 version = "1.0.0";
21
22 src = fetchFromGitHub {
23 owner = "rafaelmardojai";
24 repo = "share-preview";
25 rev = finalAttrs.version;
26 hash = "sha256-6Pk+3o4ZWF5pDYAtcBgty4b7edzIZnIuJh0KW1VW33I=";
27 };
28
29 cargoDeps = rustPlatform.fetchCargoVendor {
30 inherit (finalAttrs) src;
31 name = "share-preview-${finalAttrs.version}";
32 hash = "sha256-MC5MsoFdeCvF9nIFoYCKoBBpgGysBH36OdmTqbIJt8s=";
33 };
34
35 nativeBuildInputs = [
36 meson
37 ninja
38 pkg-config
39 rustPlatform.cargoSetupHook
40 rustc
41 cargo
42 wrapGAppsHook4
43 desktop-file-utils
44 ];
45
46 buildInputs = [
47 libadwaita
48 openssl
49 ];
50
51 env.NIX_CFLAGS_COMPILE = toString (
52 lib.optionals stdenv.hostPlatform.isDarwin [ "-Wno-error=incompatible-function-pointer-types" ]
53 );
54
55 passthru = {
56 updateScript = nix-update-script { };
57 };
58
59 meta = {
60 description = "Preview and debug websites metadata tags for social media share";
61 homepage = "https://apps.gnome.org/SharePreview";
62 downloadPage = "https://github.com/rafaelmardojai/share-preview";
63 changelog = "https://github.com/rafaelmardojai/share-preview/releases/tag/${finalAttrs.version}";
64 license = lib.licenses.gpl3Plus;
65 mainProgram = "share-preview";
66 teams = [ lib.teams.gnome-circle ];
67 platforms = lib.platforms.unix;
68 };
69})