Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mplab X IDE: init at 6.15 #301317

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14164,6 +14164,12 @@
githubId = 16027994;
name = "Nathan Viets";
};
nyadiia = {
email = "nyadiia@pm.me";
github = "nyadiia";
githubId = "43252360";
name = "Nadia";
};
nyanbinary = {
email = "nyanbinary@keemail.me";
matrix = "@niko:conduit.rs";
Expand Down
61 changes: 61 additions & 0 deletions pkgs/by-name/mi/microchip-xc-dsc/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ lib, stdenvNoCC, bubblewrap, buildFHSEnv, fakeroot, fetchurl, glibc, rsync }:

let
fhsEnv = buildFHSEnv {
name = "mplab-x-build-fhs-env";
targetPkgs = pkgs: [ fakeroot glibc ];
};

in stdenvNoCC.mkDerivation rec {
pname = "microchip-xc-dsc-unwrapped";
version = "3.00";

src = fetchurl {
url =
"https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc-dsc-v${version}-full-install-linux64-installer.run";
hash = "sha256-129EUXfFQP2p3bdoRLIlZQqg+Dy5ZJLBjHcLbxsw4bw=";
};

nativeBuildInputs = [ bubblewrap rsync ];

unpackPhase = ''
runHook preUnpack

install $src installer.run

runHook postUnpack
'';
installPhase = ''
runHook preInstall

rsync -a ${fhsEnv.fhsenv}/ chroot/
find chroot -type d -exec chmod 755 {} \;
echo "root:x:0:0:root:/root:/bin/bash" > chroot/etc/passwd
echo "root:x:0:root" > chroot/etc/group
mkdir -p chroot/tmp/home

bwrap \
--bind chroot / \
--bind /nix /nix \
--ro-bind installer.run /installer \
--setenv HOME /tmp/home \
-- /bin/fakeroot /installer \
--LicenseType FreeMode \
--mode unattended \
--netservername localhost \
--prefix $out

runHook postInstall
'';
dontFixup = true;

meta = with lib; {
homepage =
"https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers";
description =
"Microchip's MPLAB XC16 C compiler toolchain for all dsPIC DSCs";
license = licenses.unfree;
maintainers = with maintainers; [ remexre nyadiia ];
platforms = [ "x86_64-linux" ];
};
}
61 changes: 61 additions & 0 deletions pkgs/by-name/mi/microchip-xc16/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ lib, stdenvNoCC, bubblewrap, buildFHSEnv, fakeroot, fetchurl, glibc, rsync }:

let
fhsEnv = buildFHSEnv {
name = "mplab-x-build-fhs-env";
targetPkgs = pkgs: [ fakeroot glibc ];
};

in stdenvNoCC.mkDerivation rec {
pname = "microchip-xc16-unwrapped";
version = "2.10";

src = fetchurl {
url =
"https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc16-v${version}-full-install-linux64-installer.run";
hash = "sha256-1k1ec5Hshi1N0Wk2G2aAtyX4lgQ1EhcJtF6xpK/hXcg=";
};

nativeBuildInputs = [ bubblewrap rsync ];

unpackPhase = ''
runHook preUnpack

install $src installer.run

runHook postUnpack
'';
installPhase = ''
runHook preInstall

rsync -a ${fhsEnv.fhsenv}/ chroot/
find chroot -type d -exec chmod 755 {} \;
echo "root:x:0:0:root:/root:/bin/bash" > chroot/etc/passwd
echo "root:x:0:root" > chroot/etc/group
mkdir -p chroot/tmp/home

bwrap \
--bind chroot / \
--bind /nix /nix \
--ro-bind installer.run /installer \
--setenv HOME /tmp/home \
-- /bin/fakeroot /installer \
--LicenseType FreeMode \
--mode unattended \
--netservername localhost \
--prefix $out

runHook postInstall
'';
dontFixup = true;

meta = with lib; {
homepage =
"https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers";
description =
"Microchip's MPLAB XC16 C compiler toolchain for all 16-bit PIC microcontrollers (MCUs)";
license = licenses.unfree;
maintainers = with maintainers; [ remexre nyadiia ];
platforms = [ "x86_64-linux" ];
};
}
61 changes: 61 additions & 0 deletions pkgs/by-name/mi/microchip-xc32/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ lib, stdenvNoCC, bubblewrap, buildFHSEnv, fakeroot, fetchurl, glibc, rsync }:

let
fhsEnv = buildFHSEnv {
name = "mplab-x-build-fhs-env";
targetPkgs = pkgs: [ fakeroot glibc ];
};

in stdenvNoCC.mkDerivation rec {
pname = "microchip-xc32-unwrapped";
version = "4.35";

src = fetchurl {
url =
"https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc32-v${version}-full-install-linux-x64-installer.run";
hash = "sha256-TYRPGJZMn9LEoLgvITGB++xBKHzf+2s/GLSNZu/+f9Y=";
};

nativeBuildInputs = [ bubblewrap rsync ];

unpackPhase = ''
runHook preUnpack

install $src installer.run

runHook postUnpack
'';
installPhase = ''
runHook preInstall

rsync -a ${fhsEnv.fhsenv}/ chroot/
find chroot -type d -exec chmod 755 {} \;
echo "root:x:0:0:root:/root:/bin/bash" > chroot/etc/passwd
echo "root:x:0:root" > chroot/etc/group
mkdir -p chroot/tmp/home

bwrap \
--bind chroot / \
--bind /nix /nix \
--ro-bind installer.run /installer \
--setenv HOME /tmp/home \
-- /bin/fakeroot /installer \
--LicenseType FreeMode \
--mode unattended \
--netservername localhost \
--prefix $out

runHook postInstall
'';
dontFixup = true;

meta = with lib; {
homepage =
"https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers";
description =
"Microchip's MPLAB XC16 C compiler toolchain for all 32-bit PIC and SAM MCUs and MPUs featuring Arm® and MIPS® cores";
license = licenses.unfree;
maintainers = with maintainers; [ remexre nyadiia ];
platforms = [ "x86_64-linux" ];
};
}
63 changes: 63 additions & 0 deletions pkgs/by-name/mi/microchip-xc8/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{ lib, stdenvNoCC, bubblewrap, buildFHSEnv, fakeroot, fetchurl, glibc, rsync }:

let
fhsEnv = buildFHSEnv {
name = "mplab-x-build-fhs-env";
targetPkgs = pkgs: [ fakeroot glibc ];
};

in
stdenvNoCC.mkDerivation rec {
pname = "microchip-xc8-unwrapped";
version = "2.46";

src = fetchurl {
url =
"https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc8-v${version}-full-install-linux-x64-installer.run";
hash = "sha256-FlWPjPEKpq+Nla3ucC4+VwWIEM+0Tsdf1LveAYV2CSs=";
};

nativeBuildInputs = [ bubblewrap rsync ];

unpackPhase = ''
runHook preUnpack

install $src installer.run

runHook postUnpack
'';
installPhase = ''
runHook preInstall

rsync -a ${fhsEnv.fhsenv}/ chroot/
find chroot -type d -exec chmod 755 {} \;
echo "root:x:0:0:root:/root:/bin/bash" > chroot/etc/passwd
echo "root:x:0:root" > chroot/etc/group
mkdir -p chroot/tmp/home

bwrap \
--bind chroot / \
--bind /nix /nix \
--ro-bind installer.run /installer \
--setenv HOME /tmp/home \
-- /bin/fakeroot /installer \
--debuglevel 4 \
--LicenseType FreeMode \
--mode unattended \
--netservername localhost \
--prefix $out

runHook postInstall
'';
dontFixup = true;

meta = with lib; {
homepage =
"https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers";
description =
"Microchip's MPLAB XC8 C compiler toolchain for all 8-bit PIC® and AVR® microcontrollers (MCUs).";
license = licenses.unfree;
maintainers = with maintainers; [ remexre nyadiia ];
platforms = [ "x86_64-linux" ];
};
}
84 changes: 84 additions & 0 deletions pkgs/by-name/mp/mplab-x-unwrapped/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{ lib, stdenvNoCC, bubblewrap, buildFHSEnv, fakeroot, fetchurl, glibc, rsync }:

let
fhsEnv = buildFHSEnv {
name = "mplab-x-build-fhs-env";
targetPkgs = pkgs: [ fakeroot glibc ];
};

in
stdenvNoCC.mkDerivation rec {
pname = "mplab-x-unwrapped";
version = "6.15";

src = fetchurl {
url =
"https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/MPLABX-v${version}-linux-installer.tar";
hash = "sha256-ZiiijuCC4cOfJ5MdMDZ+LyUAzqIJDLTN93nKoZtpTGE=";
# The Microchip server requires this Referer to allow the download.
curlOptsList = [
"--referer"
"https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide"
];
};

outputs = [ "out" ];

nativeBuildInputs = [ bubblewrap rsync ];

unpackPhase = ''
runHook preUnpack

tar xf $src MPLABX-v${version}-linux-installer.sh
sh MPLABX-v${version}-linux-installer.sh \
--tar xf ./MPLABX-v${version}-linux-installer.run

runHook postUnpack
'';
buildPhase = ''
runHook preBuild

rsync -a ${fhsEnv.fhsenv}/ chroot/
find chroot -type d -exec chmod 755 {} \;
echo "root:x:0:0:root:/root:/bin/bash" > chroot/etc/passwd
echo "root:x:0:root" > chroot/etc/group
mkdir -p chroot/tmp/home

bwrap \
--bind chroot / \
--ro-bind /nix /nix \
--ro-bind MPLABX-v${version}-linux-installer.run /installer \
--setenv HOME /tmp/home \
-- /bin/fakeroot /installer --mode unattended

# rm -r chroot/opt/microchip/mplabx/v${version}/sys

runHook postBuild
'';
installPhase = ''
runHook preInstall

mkdir -p $out/etc $out/usr/share $out/lib/udev/
cp -r chroot/etc/.mplab_ide $out/etc/
cp -r chroot/etc/udev $out/etc/
cp -r chroot/etc/udev/rules.d $out/lib/udev/
cp -r chroot/usr/share/applications chroot/usr/share/icons $out/usr/share/
cp -r chroot/opt $out/
# cp -r chroot/usr/lib/udev

runHook postInstall
'';
dontFixup = true;

passthru = { inherit fhsEnv; };

meta = with lib; {
homepage =
"https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide";
description =
"An expandable, highly configurable software program that incorporates powerful tools to help you discover, configure, develop, debug and qualify embedded designs for most of Microchip's microcontrollers and digital signal controllers.";
license = licenses.unfree;
maintainers = with maintainers; [ remexre nyadiia ];
platforms = [ "x86_64-linux" ];
};
}
Loading