~ruther/nix-envs

4ac888d8171c0d255d18340c8e59f77523a236fc — Rutherther 1 year, 6 months ago 9029727
feat: add QtMips program
A programs/qtmips/.envrc => programs/qtmips/.envrc +1 -0
@@ 0,0 1,1 @@
use flake;

A programs/qtmips/flake.lock => programs/qtmips/flake.lock +61 -0
@@ 0,0 1,61 @@
{
  "nodes": {
    "flake-utils": {
      "inputs": {
        "systems": "systems"
      },
      "locked": {
        "lastModified": 1694529238,
        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1695563624,
        "narHash": "sha256-NVy8pK2yEHrBDaSEplR5nLwb02lOAicn7jSHNk/coGI=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "a8b1812de397c7a40a7695a2dbaaca3ae4d11d46",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "release-23.05",
        "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
}

A programs/qtmips/flake.nix => programs/qtmips/flake.nix +36 -0
@@ 0,0 1,36 @@
{
  description = "QtMips package";


  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, flake-utils, nixpkgs }: 
  let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
    qtmips = pkgs.libsForQt5.callPackage ./qtmips-pkg.nix {  };
    mipsPkgs = import nixpkgs {
      crossSystem.config = "mips-elf";
      system = "${system}";
    };
  in {
    packages.${system} = {
      QtMips = qtmips;
      default = self.packages.${system}.QtMips;
    };

    devShells.${system}.default = pkgs.mkShell {
      packages = [
        qtmips
      ];

      buildInputs = [
        mipsPkgs.buildPackages.binutils
        mipsPkgs.buildPackages.gcc
      ];
    };
  };
}

A programs/qtmips/qtmips-pkg.nix => programs/qtmips/qtmips-pkg.nix +13 -0
@@ 0,0 1,13 @@
{ lib, pkgs, system, stdenv, cmake, wrapQtAppsHook, qtbase, qtsvg }:

stdenv.mkDerivation rec {
    name = "QtMips";
    src = pkgs.fetchFromGitHub {
      owner = "cvut";
      repo = "QtMips";
      rev = "3d8ea4a7a2aa4c95e3e270111f6128686203913c";
      hash = "sha256-S1d64m3niAiDtnT8EpgoAUb6shZK/mv8MQM95ytipuI=";
    };
    nativeBuildInputs = [ cmake wrapQtAppsHook ];
    buildInputs = [ qtbase ];
}

Do not follow this link