summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi2019-12-09 19:02:39 +0200
committerFelipe Balbi2019-12-11 14:38:38 +0200
commit1d7bac2082934e4d1a7ea831f7ff48ef46c854b3 (patch)
treef383ef6e584e901abbcd8895008ebdaed37bfd20
downloadaur-1d7bac2082934e4d1a7ea831f7ff48ef46c854b3.tar.gz
PKGBUILD for Azure Sphere SDK
Signed-off-by: Felipe Balbi <felipe.balbi@microsoft.com>
-rw-r--r--.SRCINFO27
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD58
-rw-r--r--azure-sphere-sdk.install7
-rw-r--r--azure-sphere-sdk.sysusers1
-rw-r--r--azure-sphere-sdk.udev3
6 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fa256a3a1652
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = azure-sphere-sdk
+ pkgdesc = Azure Sphere SDK Preview for Linux
+ pkgver = 19.09Beta
+ pkgrel = 1
+ url = https://aka.ms/AzureSphereSDK
+ install = azure-sphere-sdk.install
+ arch = x86_64
+ license = custom
+ depends = cmake
+ depends = curl
+ depends = flex
+ depends = libmpc
+ depends = net-tools
+ depends = ninja
+ optdepends = minicom: for serial communication with the Sphere board
+ optdepends = code: for software development
+ options = !strip
+ options = staticlibs
+ source = azure-sphere-sdk-19.09Beta.tar.gz::https://software-download.microsoft.com/download/pr/Azure_Sphere_SDK_Preview_Bundle.tar.gz
+ source = azure-sphere-sdk.udev
+ source = azure-sphere-sdk.sysusers
+ sha256sums = 6518bb29ef7d6c40701ef1420bbd3dcf068236939f0e8e11c30769857dd34837
+ sha256sums = 649ec04bdd0c052838bf3364fdd32313264891c4f7f60039cb644ef79c3c589f
+ sha256sums = 323c5e51b6bcf92c7e024cfd6bd6843cb57531317c6ef887b1bced81e920d43e
+
+pkgname = azure-sphere-sdk
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b7cd65d750a9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*.pkg.tar.xz
+*.tar.gz
+*.pgp
+azurespheresdk/
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d6714cf88e0f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Felipe Balbi <felipe.balbi@microsoft.com>
+pkgname=azure-sphere-sdk
+pkgver=19.09Beta
+pkgrel=1
+pkgdesc="Azure Sphere SDK Preview for Linux"
+arch=('x86_64')
+url="https://aka.ms/AzureSphereSDK"
+license=('custom')
+depends=('cmake'
+ 'curl'
+ 'flex'
+ 'libmpc'
+ 'net-tools'
+ 'ninja')
+install="${pkgname}".install
+optdepends=('minicom: for serial communication with the Sphere board'
+ 'code: for software development')
+options=(!strip staticlibs)
+source=("${pkgname}-${pkgver}.tar.gz::https://software-download.microsoft.com/download/pr/Azure_Sphere_SDK_Preview_Bundle.tar.gz"
+ "azure-sphere-sdk.udev"
+ "azure-sphere-sdk.sysusers")
+sha256sums=('6518bb29ef7d6c40701ef1420bbd3dcf068236939f0e8e11c30769857dd34837'
+ '649ec04bdd0c052838bf3364fdd32313264891c4f7f60039cb644ef79c3c589f'
+ '323c5e51b6bcf92c7e024cfd6bd6843cb57531317c6ef887b1bced81e920d43e')
+
+prepare() {
+ tar -zxf "Azure_Sphere_SDK_Preview.tar.gz"
+}
+
+build() {
+ find "${srcdir}" -type d -exec chmod 755 {} \;
+ find "${srcdir}" -type f -exec chmod 644 {} \;
+ chmod 755 "${srcdir}"/azurespheresdk/Tools/azsphere
+ chmod 755 "${srcdir}"/azurespheresdk/Tools/azsphere_slattach
+ chmod 755 "${srcdir}"/azurespheresdk/Tools/azsphere_connect.sh
+
+ for sysroot in 3 3+Beta1909; do
+ chmod 755 "${srcdir}"/azurespheresdk/Sysroots/"${sysroot}"/tools/exp23-appsdk-linux-blanca.sh
+ "${srcdir}"/azurespheresdk/Sysroots/"${sysroot}"/tools/exp23-appsdk-linux-blanca.sh -d "${srcdir}"/azurespheresdk/Sysroots/"${sysroot}"/tools/ -y
+ done
+}
+
+package() {
+ install -Dm644 "${srcdir}"/azurespheresdk/LICENSE.TXT "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
+ install -Dm644 "${srcdir}"/"${pkgname}".udev "${pkgdir}"/etc/udev/rules.d/75-mt3620.rules
+ install -Dm644 "${srcdir}"/"${pkgname}".sysusers "${pkgdir}"/usr/lib/sysusers.d/"${pkgname}".conf
+
+ mkdir -p "${pkgdir}"/opt/azurespheresdk
+ for DIR in BoardConfigPresets CMakeFiles Tools DebugTools Sysroots; do
+ cp -r "${srcdir}"/azurespheresdk/"${DIR}" "${pkgdir}"/opt/azurespheresdk
+ done
+
+ mkdir -p "${pkgdir}"/usr/bin
+ for i in azsphere azsphere_connect.sh azsphere_slattach; do
+ ln -s ../../opt/azurespheresdk/Tools/"$i" "${pkgdir}"/usr/bin/"$i"
+ done
+}
+
diff --git a/azure-sphere-sdk.install b/azure-sphere-sdk.install
new file mode 100644
index 000000000000..e2baf142f50f
--- /dev/null
+++ b/azure-sphere-sdk.install
@@ -0,0 +1,7 @@
+post_install() { cat <<EOT
+Add users who should manage 'azsphere' devices to
+the 'azsphere' group with:
+
+ # usermod -a -G azsphere USERNAME
+EOT
+}
diff --git a/azure-sphere-sdk.sysusers b/azure-sphere-sdk.sysusers
new file mode 100644
index 000000000000..0457874c88c7
--- /dev/null
+++ b/azure-sphere-sdk.sysusers
@@ -0,0 +1 @@
+g azuresphere - -
diff --git a/azure-sphere-sdk.udev b/azure-sphere-sdk.udev
new file mode 100644
index 000000000000..24a51813c1f3
--- /dev/null
+++ b/azure-sphere-sdk.udev
@@ -0,0 +1,3 @@
+# Grant ownership of Azure Sphere (MT3620) USB devices to the azsphere group
+
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="6011", ATTRS{idProduct}=="0403", ATTRS{product}=="MSFT MT3620 Std Interface", GROUP="azsphere"