|
1 | 1 | { |
2 | | - stdenv, |
3 | 2 | lib, |
4 | | - makeWrapper, |
5 | | - bash, |
| 3 | + python3Packages, |
| 4 | + fetchFromGitHub, |
| 5 | + fetchPypi, |
6 | 6 | }: |
7 | 7 | ############ |
8 | 8 | # Packages # |
9 | 9 | ######################################################################### |
10 | 10 | let |
11 | | - iconPath = "icon.png"; |
12 | | - name = "Exemple Application"; |
13 | | - comment = "Exemple Application"; |
14 | | -in |
15 | | -# --------------------------------------------------------------------- # |
16 | | -stdenv.mkDerivation (finalAttrs: { |
17 | | - pname = "exemple"; |
18 | | - version = "24.05-15-06-2024"; |
| 11 | + comment = "Python3 Hello World"; |
| 12 | + pname = "pip-hello-world"; |
| 13 | + version = "0.1"; |
| 14 | +in python3Packages.buildPythonApplication rec { |
19 | 15 | ## ----------------------------------------------------------------- ## |
20 | | - src = ./src; |
| 16 | + inherit pname version; |
| 17 | + format = "pyproject"; # for not setup.py |
| 18 | + dontUseCmakeConfigure = true; # for not setup.py |
| 19 | + doCheck = false; |
21 | 20 | ## ----------------------------------------------------------------- ## |
22 | | - nativeBuildInputs = [ makeWrapper ]; |
| 21 | + src = fetchPypi { |
| 22 | + inherit pname version; |
| 23 | + hash = "sha256-framXG712U7EWdZAP5Xz7dzEGkomaF7aoF7kX6sq5GU="; |
| 24 | + }; |
23 | 25 | ## ----------------------------------------------------------------- ## |
24 | | - prePatch = '' |
25 | | - patchShebangs . ; |
26 | | -
|
27 | | - substituteInPlace exemple \ |
28 | | - --replace-fail "exemple-2" "${placeholder "out"}/bin/exemple-2" |
29 | | - ''; |
| 26 | + # src = fetchFromGitHub { |
| 27 | + # owner = "pedrocunial"; |
| 28 | + # repo = "pip-helloworld"; |
| 29 | + # rev = version; # 7385eb989647509325d4f8f60e839ee699f5802a |
| 30 | + # sha256 = ""; |
| 31 | + # }; |
30 | 32 | ## ----------------------------------------------------------------- ## |
31 | | - installPhase = '' |
32 | | - runHook preInstall |
33 | | -
|
34 | | - mkdir -p $out/bin/ $out/Applications/ |
35 | | - cp -r ./ $out/Applications/${finalAttrs.pname}/ |
36 | | -
|
37 | | - install -Dm 755 ${finalAttrs.pname} $out/bin/${finalAttrs.pname} |
38 | | - install -Dm 755 exemple-2 $out/bin/exemple-2 |
39 | | -
|
40 | | - echo -e "[Desktop Entry]\n" \ |
41 | | - "Type=Application\n" \ |
42 | | - "Name=${name}\n" \ |
43 | | - "Comment=${comment}\n" \ |
44 | | - "Icon=$out/Applications/${finalAttrs.pname}/${iconPath}\n" \ |
45 | | - "Exec=$out/bin/${finalAttrs.pname}\n" \ |
46 | | - "Terminal=false" > ./${finalAttrs.pname}.desktop |
47 | | -
|
48 | | - install -D ${finalAttrs.pname}.desktop \ |
49 | | - $out/share/applications/${finalAttrs.pname}.desktop |
50 | | -
|
51 | | - runHook postInstall |
52 | | - ''; |
| 33 | + # nativeBuildInputs = [ |
| 34 | + # ]; |
| 35 | + # |
| 36 | + # buildInputs = [ |
| 37 | + # ]; |
53 | 38 | ## ----------------------------------------------------------------- ## |
54 | | - postFixup = '' |
55 | | - wrapProgram $out/bin/exemple-2 \ |
56 | | - --prefix PATH : ${lib.makeBinPath [ |
57 | | - bash |
58 | | - ]} |
59 | | - ''; |
| 39 | + propagatedBuildInputs = with python3Packages; [ |
| 40 | + setuptools |
| 41 | + ]; |
60 | 42 | ## ----------------------------------------------------------------- ## |
61 | | - meta = { |
| 43 | + meta = with lib; { |
62 | 44 | description = comment; |
63 | | - homepage = "https://github.com/RevoluNix/pkgs-template/"; |
64 | | - maintainers = with lib.maintainers; [ pikatsuto ]; |
65 | | - licenses = lib.licenses.lgpl2; |
66 | | - platforms = lib.platforms.linux; |
67 | | - mainProgram = finalAttrs.pname; |
| 45 | + homepage = "https://github.com/RevoluNix/pkg-python311Package.template/"; |
| 46 | + license = licenses.lgpl2; |
| 47 | + platforms = platforms.linux; |
| 48 | + maintainers = with maintainers; [ pikatsuto ]; |
| 49 | + mainProgram = pname; |
68 | 50 | }; |
69 | 51 | ####################################################################### |
70 | | -}) |
| 52 | +} |
0 commit comments