commit c96794378a7cbc9799ab8bd16d380d88a9714199 Author: Bartłomiej Pluta Date: Thu Jan 8 20:48:45 2026 +0100 Init repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2f5dd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result \ No newline at end of file diff --git a/concraft-pl/default.nix b/concraft-pl/default.nix new file mode 100644 index 0000000..b22db0a --- /dev/null +++ b/concraft-pl/default.nix @@ -0,0 +1,33 @@ +{ + lib, + stdenv, + fetchzip, + autoPatchelfHook, + libgcc, + zlib, + gmp, + ... +}: +stdenv.mkDerivation { + pname = "concraft-pl"; + version = "2020-05-13"; + + src = fetchzip { + url = "https://zil.ipipan.waw.pl/Concraft?action=AttachFile&do=get&target=Concraft-Linux.zip"; + hash = "sha256-7CxCwaSgi8wIKxoaaMMT8DRApJj6eGsvgr0s6/YXn6g="; + }; + + buildInputs = [ + autoPatchelfHook + + gmp + zlib + libgcc + stdenv.cc.cc.lib + ]; + + installPhase = '' + mkdir -p "$out/bin"; + install -Dm 755 concraft-pl $out/bin; + ''; +} diff --git a/conmorfeusz/conmorfeusz/__init__.py b/conmorfeusz/conmorfeusz/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conmorfeusz/conmorfeusz/main.py b/conmorfeusz/conmorfeusz/main.py new file mode 100644 index 0000000..8f06bf2 --- /dev/null +++ b/conmorfeusz/conmorfeusz/main.py @@ -0,0 +1,6 @@ +import morfeusz2 +def main(): + morf = morfeusz2.Morfeusz() + analysis = morf.analyse('Ala ma kota.') + for i, j, interp in analysis: + print(i, j, interp) \ No newline at end of file diff --git a/conmorfeusz/default.nix b/conmorfeusz/default.nix new file mode 100644 index 0000000..aaa90b8 --- /dev/null +++ b/conmorfeusz/default.nix @@ -0,0 +1,51 @@ +{ + pkgs, + fetchurl, + libgcc, + stdenv, + autoPatchelfHook, + ... +}: let + python = pkgs.python311; # Możesz zmienić wersję Python + pythonPackages = python.pkgs; + + morfeusz2 = pythonPackages.buildPythonPackage rec { + pname = "morfeusz2"; + version = "1.99.12"; + + src = fetchurl { + url = "https://files.pythonhosted.org/packages/08/d6/af24fb23423ffb404b601ef75da20a7339b40e2e3992cd0213db9ab0b889/morfeusz2-1.99.12-cp36-abi3-manylinux_2_28_x86_64.whl"; + hash = "sha256-wxFwDiRQ4g5FhMmEHf9450Jh3BeB14BXxgsNjv/o0Ac="; + }; + + format = "wheel"; + + propagatedBuildInputs = with pythonPackages; [ + setuptools + wheel + ]; + + nativeBuildInputs = with pythonPackages; [ + libgcc + stdenv.cc.cc.lib + autoPatchelfHook + ]; + }; +in + pythonPackages.buildPythonPackage rec { + pname = "conmorfeusz"; + version = "0.1.0"; + + src = ./.; + + pyproject = true; + + propagatedBuildInputs = with pythonPackages; [ + morfeusz2 + ]; + + nativeBuildInputs = with pythonPackages; [ + setuptools + wheel + ]; + } diff --git a/conmorfeusz/pyproject.toml b/conmorfeusz/pyproject.toml new file mode 100644 index 0000000..5b6c572 --- /dev/null +++ b/conmorfeusz/pyproject.toml @@ -0,0 +1,19 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "conmorfeusz" +version = "0.1.0" +description = "Connects Morfeusz and Concraft-pl glued together" +requires-python = "==3.6" + +dependencies = [ + "morfeusz2==1.99.12" +] + +[tool.setuptools] +packages = ["conmorfeusz"] + +[project.scripts] +conmorfeusz = "conmorfeusz.main:main" \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7b5fb12 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1767767207, + "narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5912c1772a44e31bf1c63c0390b90501e5026886", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..381f625 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Flake which provides a Conmorfeusz (app that glues Morfeusz and Concraft-pl together) as well as Morfeusz and Concraft-pl"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages.${system}; + conmorfeusz = pkgs.callPackage ./conmorfeusz {inherit self;}; + morfeusz = pkgs.callPackage ./morfeusz {inherit self;}; + concraft-pl = pkgs.callPackage ./concraft-pl {inherit self;}; + in { + packages = rec { + inherit conmorfeusz morfeusz concraft-pl; + default = conmorfeusz; + }; + + # Aplikacje do uruchomienia + apps.default = flake-utils.lib.mkApp { + drv = conmorfeusz; + name = "conmorfeusz"; # Nazwa skryptu/modułu do uruchomienia + }; + }); +} diff --git a/morfeusz/default.nix b/morfeusz/default.nix new file mode 100644 index 0000000..641a975 --- /dev/null +++ b/morfeusz/default.nix @@ -0,0 +1,32 @@ +{ + pkgs, + lib, + stdenv, + autoPatchelfHook, + libgcc, + ... +}: +stdenv.mkDerivation { + pname = "morfeusz"; + version = "2025.11.16"; + + src = builtins.fetchTarball { + url = "http://download.sgjp.pl/morfeusz/20251116/Linux/manylinux_2_28/64/morfeusz2-1.99.12.sgjp.20251116-Linux-amd64.tar.gz"; + sha256 = "sha256:09dya2pjbvh9i8d7fgcl4hgmmf9x3vwgiq7fm3n5b4c8ic495wgh"; + }; + + buildInputs = [ + autoPatchelfHook + + libgcc + stdenv.cc.cc.lib + ]; + + installPhase = '' + mkdir -p $out/{bin,lib,include}; + + install -Dm 755 $src/bin/* $out/bin/; + install -Dm 755 $src/lib/* $out/lib/; + install -Dm 755 $src/include/* $out/include/; + ''; +}