Skip to content

Commit

Permalink
Merge branch 'moss-flarum-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
DMills27 committed Aug 3, 2023
2 parents 276b958 + 50e9cb8 commit 4f847b1
Show file tree
Hide file tree
Showing 10 changed files with 342 additions and 28 deletions.
22 changes: 14 additions & 8 deletions all-packages.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{newScope, ...}: let
self = rec {
flarum = callPackage ./pkgs/flarum { };
flarum = callPackage ./pkgs/flarum { };
gnunet-messenger-cli = callPackage ./pkgs/gnunet-messenger-cli { };
liberaforms = callPackage ./pkgs/liberaforms { };
liberaforms-env = callPackage ./pkgs/liberaforms/env.nix { };
libgnunetchat = callPackage ./pkgs/libgnunetchat { };
flarum = callPackage ./pkgs/flarum {};
gnunet-messenger-cli = callPackage ./pkgs/gnunet-messenger-cli {};
kikit = callPackage ./pkgs/kikit {};
liberaforms = callPackage ./pkgs/liberaforms {};
liberaforms-env = callPackage ./pkgs/liberaforms/env.nix {};
libgnunetchat = callPackage ./pkgs/libgnunetchat {};
};

callPackage = newScope self;
callPackages = newScope self;
nixpkgs-candidates = {
pcbnew-transition = callPackage ./nixpkgs-candidates/pcbnew-transition {};
pybars3 = callPackage ./nixpkgs-candidates/pybars3 {};
pymeta3 = callPackage ./nixpkgs-candidates/pymeta3 {};
euclid3 = callPackage ./nixpkgs-candidates/euclid3 {};
};

callPackage = newScope (self // nixpkgs-candidates // {inherit callPackage;});
in
self
19 changes: 2 additions & 17 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

inputs.php-nixpkgs.url = "github:drupol/nixpkgs?ref=php/add-new-builder";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.php-nixpkgs.url = "github:drupol/nixpkgs?ref=php/add-new-builder";
inputs.flake-utils.url = "github:numtide/flake-utils";
# Set the defaultSystem list for flake-utils to only x86_64-linux
inputs.systems.url = "github:nix-systems/x86_64-linux";
Expand All @@ -13,15 +14,17 @@
outputs = {
self,
nixpkgs,
php-nixpkgs,
flake-utils,
treefmt-nix,
...
}: let
buildOutputs = system: let
pkgs = nixpkgs.legacyPackages.${system};
php-pkgs = php-nixpkgs.legacyPackages.${system};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in {
packages = import ./all-packages.nix {inherit (pkgs) newScope;};
packages = import ./all-packages.nix {inherit (php-pkgs) newScope;};
nixosModules = {
modules = import ./modules/all-modules.nix;
ngipkgs = {...}: {
Expand Down
27 changes: 27 additions & 0 deletions nixpkgs-candidates/euclid3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
python3,
lib,
fetchPypi,
}: let
inherit (python3.pkgs) buildPythonPackage;
in
buildPythonPackage rec {
pname = "euclid3";
version = "0.01";
format = "setuptools";

src = fetchPypi {
inherit pname version;
hash = "sha256-JbgnpXrb/Zo/qGJeQ6vD6Qf2HeYiND5+U4SC75tG/Qs=";
};

pythonImportsCheck = [
"euclid3"
];

meta = with lib; {
description = "2D and 3D vector, matrix, quaternion and geometry module.";
homepage = "http://code.google.com/p/pyeuclid/";
license = licenses.lgpl21Plus;
};
}
40 changes: 40 additions & 0 deletions nixpkgs-candidates/pcbnew-transition/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
python3,
fetchPypi,
lib,
}: let
inherit (python3.pkgs) buildPythonPackage;

properCaseName = "pcbnewTransition";
in
buildPythonPackage rec {
pname = properCaseName;
version = "0.3.4";
format = "setuptools";

disabled = python3.pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-3CJUG1kd63Lg0r9HpJRIvttHS5s2EuZRoxeXrqsJ/kQ=";
};

propagatedBuildInputs = with python3.pkgs; [
kicad
];

nativeBuildInputs = with python3.pkgs; [
versioneer
];

pythonImportsCheck = [
properCaseName
];

meta = with lib; {
description = "Library that allows you to support both, KiCAD 5 and KiCAD 6 in your plugins";
homepage = "https://github.com/yaqwsx/pcbnewTransition";
changelog = "https://github.com/yaqwsx/pcbnewTransition/releases/tag/v${version}";
license = licenses.mit;
};
}
37 changes: 37 additions & 0 deletions nixpkgs-candidates/pybars3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
python3,
fetchPypi,
lib,
pymeta3,
}:
python3.pkgs.buildPythonPackage rec {
pname = "pybars3";
version = "0.9.7";
format = "setuptools";

src = fetchPypi {
inherit pname version;
hash = "sha256-ashH6QXlO5xbk2rxEskQR14nv3Z/efRSjBb5rx7A4lI=";
};

propagatedBuildInputs = with python3.pkgs; [
pymeta3
];

checkPhase = ''
runHook preCheck
${python3.interpreter} tests.py
runHook postCheck
'';

pythonImportsCheck = [
"pybars"
];

meta = with lib; {
description = "Handlebars.js template support for Python 3 and 2";
homepage = "https://github.com/wbond/pybars3";
changelog = "https://github.com/wbond/pybars3/releases/tag/${version}";
license = licenses.lgpl3Only;
};
}
32 changes: 32 additions & 0 deletions nixpkgs-candidates/pymeta3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
python3,
fetchPypi,
lib,
}: let
inherit (python3.pkgs) buildPythonPackage;
properCaseName = "PyMeta3";
in
buildPythonPackage rec {
pname = lib.toLower properCaseName;
version = "0.5.1";
format = "setuptools";

src = fetchPypi {
inherit version;
pname = properCaseName;
hash = "sha256-GL2jJtmpu/WHv8DuC8loZJZNeLBnKIvPVdTZhoHQW8s=";
};

doCheck = false; # Tests do not support Python3

pythonImportsCheck = [
"pymeta"
];

meta = with lib; {
description = "Pattern-matching language based on OMeta for Python 3 and 2";
homepage = "https://github.com/wbond/pymeta3";
changelog = "https://github.com/wbond/pymeta3/releases/tag/${version}";
license = licenses.mit;
};
}
8 changes: 6 additions & 2 deletions pkgs/flarum/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{ fetchFromGitHub, fetchurl, lib, php }:

{
fetchFromGitHub,
fetchurl,
lib,
php,
}:
php.buildComposerProject (finalAttrs: {
pname = "flarum";
version = "1.8.0";
Expand Down
90 changes: 90 additions & 0 deletions pkgs/kikit/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
lib,
pcbnew-transition,
pybars3,
python3,
fetchFromGitHub,
bats,
callPackage,
}: let
properCaseName = "KiKit";

solidpython = callPackage ./solidpython {};

# https://github.com/yaqwsx/KiKit/issues/574
shapelyPkgsRoot = fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "8d8e62e74f511160a599471549a98bc9e4f4818d";
sha256 = "sha256-2vm6IAnaCo5KAA5/rWSb6dzJsS/raEqR93xbM2/jgng=";
};

shapelyFile = "${shapelyPkgsRoot}/pkgs/development/python-modules/shapely";

shapely =
python3.pkgs.callPackage
shapelyFile
{};
in
python3.pkgs.buildPythonPackage rec {
pname = lib.toLower properCaseName;
version = "1.3.0";
format = "setuptools";

disabled = python3.pythonOlder "3.7";

src = fetchFromGitHub {
owner = "yaqwsx";
repo = properCaseName;
rev = "v${version}";
hash = "sha256-kDTPk/R3eZtm4DjoUV4tSQzjGQ9k8MKQedX4oUXYzeo=";
};

propagatedBuildInputs = with python3.pkgs;
[
kicad
numpy
click
markdown2
commentjson
# https://github.com/yaqwsx/KiKit/issues/575
wxPython_4_2
]
++ [
pcbnew-transition
shapely
pybars3
# https://github.com/yaqwsx/KiKit/issues/576
solidpython
];

nativeBuildInputs = with python3.pkgs; [
versioneer
];

nativeCheckInputs = with python3.pkgs;
[
pytest
]
++ [
bats
];

pythonImportsCheck = [
pname
];

checkPhase = ''
runHook preCheck
export PATH=$PATH:$out/bin
make test
runHook postCheck
'';

meta = with lib; {
description = "Automation for KiCAD boards";
homepage = "https://github.com/yaqwsx/KiKit/";
changelog = "https://github.com/yaqwsx/KiKit/releases/tag/v${version}";
license = licenses.mit;
};
}
Loading

0 comments on commit 4f847b1

Please sign in to comment.