Skip to content

Commit

Permalink
Package improvements (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonko0493 authored Jun 15, 2023
1 parent f440893 commit 2442d72
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 10 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
* On macOS and Linux, run `sudo dkp-pacman -S nds-dev` from the terminal after installing the devkitPro pacman distribution.

#### Installing OpenAL (Linux)
If you're running on Linux, you will also need to install OpenAL, needed for audio processing. On Ubuntu/Debian (which are the distros we test on), it can be installed in a single command:
```bash
sudo apt install libopenal-dev
```
If you're running on Linux and _not using one of the package releases_ (the `.deb` or `.rpm`), you will also need to install OpenAL which is used for audio processing.

### Download & Install
Once you have installed any necessary prerequisites, to install Serial Loops, download the latest release for your platform from the [Releases tab](https://github.com/haroohie-club/SerialLoops/releases).
Expand Down
2 changes: 1 addition & 1 deletion SerialLoops.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1F8886B6-C
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "platforms", "platforms", "{D63057DD-B2DB-49A0-8680-0CDBE6268550}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoopyUpdater", "LoopyUpdater\LoopyUpdater.csproj", "{1335EA86-D7F4-4779-84DC-A8A52E2571AC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoopyUpdater", "install\LoopyUpdater\LoopyUpdater.csproj", "{1335EA86-D7F4-4779-84DC-A8A52E2571AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
51 changes: 46 additions & 5 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ stages:
rid: 'linux-x64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net6.0/linux-x64/publish.tar.gz'
secondArtifactPath: '$(Build.SourcesDirectory)/dpkg-build/SerialLoops.deb'
thirdArtifactPath: '$(Build.SourcesDirectory)/rpmbuild/RPMS/x86_64/SerialLoops-$(Version)-1.fc38.x86_64.rpm'
extraPublishParams: ''
macOS-x64:
imageName: 'macOS-latest'
Expand All @@ -55,6 +56,7 @@ stages:
rid: 'osx-x64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Mac/Release/net6.0/osx-x64/SerialLoops.Mac.dmg'
secondArtifactPath: ''
thirdArtifactPath: ''
extraPublishParams: '/p:EnableDmgBuild=true'
macOS-arm64:
imageName: 'macOS-latest'
Expand All @@ -64,6 +66,7 @@ stages:
rid: 'osx-arm64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Mac/Release/net6.0/osx-arm64/SerialLoops.Mac.dmg'
secondArtifactPath: ''
thirdArtifactPath: ''
extraPublishParams: '/p:EnableDmgBuild=true'
Windows:
imageName: 'windows-latest'
Expand All @@ -73,14 +76,24 @@ stages:
rid: 'win-x64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Wpf/Release/net6.0-windows/win-x64/publish.zip'
secondArtifactPath: ''
thirdArtifactPath: ''
extraPublishParams: ''
displayName: Build & Publish
pool:
vmImage: $(imageName)
steps:
- checkout: self
clean: true


- pwsh: |
Push-Location ..
Move-Item s SerialLoops-$(Version)
tar -czvf SerialLoops-$(Version).tar.gz SerialLoops-$(Version)
Move-Item SerialLoops-$(Version) s
Pop-Location
displayName: Create source tar.gz for rpm package
condition: eq(variables['rid'], 'linux-x64')
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
Expand All @@ -103,15 +116,25 @@ stages:
mkdir -p dpkg-build/SerialLoops/usr/lib/SerialLoops
mkdir -p dpkg-build/SerialLoops/usr/share/applications
Push-Location dpkg-build/SerialLoops
Write-Output "Package: SerialLoops`nVersion: $(Version)`nSection: custom`nPriority: optional`nArchitecture: all`nEssential: no`nMaintainer: The Haroohie Translation Club <[email protected]>`nHomepage: https://haroohie.club/`nDescription: Editor for Suzumiya Haruhi no Chokuretsu`n" | Out-File -FilePath DEBIAN/control
Write-Output "Package: SerialLoops`nVersion: $(Version)`nSection: custom`nPriority: optional`nArchitecture: all`nEssential: no`nDepends: libopenal-dev`nMaintainer: The Haroohie Translation Club <[email protected]>`nHomepage: https://haroohie.club/`nDescription: Editor for Suzumiya Haruhi no Chokuretsu`n" | Out-File -FilePath DEBIAN/control
Write-Output "[Desktop Entry]`nVersion=$(Version)`nName=Serial Loops`nComment=Editor for Suzumiya Haruhi no Chokuretsu`nExec=/usr/bin/SerialLoops`nIcon=/usr/lib/SerialLoops/Icons/AppIcon.png`nTerminal=false`nType=Application`nCategories=Utility;Application;`n" | Out-File -FilePath usr/share/applications/SerialLoops.desktop
chmod 777 usr/lib/SerialLoops
chmod +x usr/share/applications/SerialLoops.desktop
mv $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net6.0/linux-x64/publish/* usr/lib/SerialLoops
ln -s /usr/lib/SerialLoops/SerialLoops usr/bin/SerialLoops
cd ..
dpkg-deb --build SerialLoops
displayName: Create Linux tar and dpkg
Pop-Location
mkdir -p rpmbuild/BUILD
mkdir -p rpmbuild/RPMS
mkdir -p rpmbuild/SOURCES
mkdir -p rpmbuild/SPECS
mkdir -p rpmbuild/SRPMS
mv $(Build.SourcesDirectory)/../SerialLoops-$(Version).tar.gz $(Build.SourcesDirectory)/rpmbuild/SOURCES/
Write-Output "Name: SerialLoops`nVersion: $(Version)`nRelease: 1%{?dist}`nSummary: Editor for Suzumiya Haruhi no Chokuretsu`nExclusiveArch: x86_64`n`nLicense: GPLv3`nURL: https://haroohie.club/chokuretsu/serial-loops`nSource0: %{name}-%{version}.tar.gz`nSource1: https://github.com/haroohie-club/SerialLoops`n`nBuildRequires: dotnet-sdk-6.0`nRequires: openal-soft`n`n%global debug_package %{nil}`n%define __os_install_post %{nil}`n`n%description`nAn editor for the Nintendo DS game Suzumiya Haruhi no Chokuretsu (The Series of Haruhi Suzumiya)`n`n%prep`n%setup -q`n`n%build`ndotnet publish src/SerialLoops.Gtk/SerialLoops.Gtk.csproj -c Release -f net6.0 -r linux-x64 --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true`n`n%install`nrm -rf %{buildroot}`nmkdir -p %{buildroot}/%{_bindir}`nmkdir -p %{buildroot}/%{_libdir}/SerialLoops`nmkdir -p %{buildroot}/%{_datadir}/applications`ncp -r src/SerialLoops.Gtk/bin/Release/net6.0/linux-x64/publish/* %{buildroot}/%{_libdir}/SerialLoops/`nchmod 777 %{buildroot}/%{_libdir}/SerialLoops/`nln -s %{_libdir}/SerialLoops/SerialLoops %{buildroot}/%{_bindir}/SerialLoops`nprintf `"[Desktop Entry]\nVersion=%{version}\nName=Serial Loops\nComment=Editor for Suzumiya Haruhi no Chokuretsu\nExec=%{_bindir}/SerialLoops\nIcon=%{_libdir}/SerialLoops/Icons/AppIcon.png\nTerminal=false\nType=Application\nCategories=Utility;Application;\n`" > %{buildroot}/%{_datadir}/applications/SerialLoops.desktop`nchmod +x %{buildroot}/%{_datadir}/applications/SerialLoops.desktop`n`n%files`n%dir %{_libdir}/SerialLoops`n%{_bindir}/SerialLoops`n%{_libdir}/SerialLoops`n%{_datadir}/applications/SerialLoops.desktop`n" | Out-File -FilePath rpmbuild/SPECS/SerialLoops.spec
chmod +x $(Build.SourcesDirectory)/install/rpm-scripts/rpm-make.sh
docker run -v $(Build.SourcesDirectory)/install/rpm-scripts:/rpm-scripts -v $(Build.SourcesDirectory)/rpmbuild:/root/rpmbuild -e VERSION=$(Version) fedora /rpm-scripts/rpm-make.sh
displayName: Create Linux tar, dpkg, and rpm
condition: eq(variables['rid'], 'linux-x64')
# We need a second round of publishing to get dmg packing to work. Idk why, but it works if we do it this way lol
Expand Down Expand Up @@ -141,6 +164,14 @@ stages:
publishLocation: 'Container'
displayName: Publish secondary build artifact
condition: ne(variables['secondArtifactPath'], '')

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(thirdArtifactPath)'
ArtifactName: '$(artifactName)-3'
publishLocation: 'Container'
displayName: Publish tertiary build artifact
condition: ne(variables['thirdArtifactPath'], '')
- stage: Publish
dependsOn: Build
jobs:
Expand All @@ -157,12 +188,19 @@ stages:
artifactName: 'Linux-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux dpkg
displayName: Download Linux deb
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-2'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux rpm
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-3'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download macOS x64 artifacts
inputs:
Expand All @@ -187,6 +225,7 @@ stages:
- pwsh: |
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)/publish.tar.gz -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-linux-x64-v$(Version).tar.gz
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-2/SerialLoops.deb -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-$(Version)_amd64.deb
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-3/SerialLoops-$(Version)-1.fc38.x86_64.rpm -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-$(Version)-1.fc38.x86_64.rpm
Move-Item -Path $(Build.ArtifactStagingDirectory)/macOS-x64-v$(Version)/SerialLoops.Mac.dmg -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-macOS-x64-v$(Version).dmg
Move-Item -Path $(Build.ArtifactStagingDirectory)/macOS-arm-v$(Version)/SerialLoops.Mac.dmg -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-macOS-arm-v$(Version).dmg
Move-Item -Path $(Build.ArtifactStagingDirectory)/Windows-v$(Version)/publish.zip -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-windows-x64-v$(Version).zip
Expand All @@ -205,7 +244,9 @@ stages:
## Installation Notes
On macOS, after dragging the app from the dmg into Applications, please run `xattr -cr /Applications/SerialLoops.Mac.app` from the Terminal in order to be able to run the app. This is required because we currently don't codesign the application, meaning macOS will refuse to run it without explicit approval from you.
The `.deb` package can only be used on Debian-based systems (e.g. Ubuntu). Install it with `sudo dpkg -i SerialLoops-$(Version)_amd64.deb`. For other Linux distros, please use the binaries packaged in the `.tar.gz` archive. Regardless of your distro, ensure you install the OpenAL binaries so audio playback works &ndash; on Ubuntu, this can be done with `sudo apt install libopenal-dev`.
The `.deb` package is intended for Debian-based distros (e.g. Ubuntu). Install it with `sudo apt install -f ./SerialLoops-$(Version)_amd64.deb`.
The `.rpm` package is intended for Red Hat distros (e.g. Fedora). Install it with `sudo dnf install ./SerialLoops-$(Version)-1.fc38.x86_64.rpm`.
For other Linux distros, please use the binaries packaged in the `.tar.gz` archive; when doing so, ensure you install the OpenAL binaries so audio playback works.
Please ensure you have installed [devkitARM from devkitPro](https://devkitpro.org/wiki/Getting_Started) before using the program.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions install/rpm-scripts/rpm-make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

dnf install -y rpmdevtools rpmlint dotnet-sdk-6.0
rpmbuild -bb /root/rpmbuild/SPECS/SerialLoops.spec

0 comments on commit 2442d72

Please sign in to comment.