From e14dda069567b872c2990c23b96a6f9b4a02555b Mon Sep 17 00:00:00 2001 From: phil-harmoniq Date: Mon, 11 Sep 2017 14:24:04 -0400 Subject: [PATCH 1/8] Update Shell.NET library --- README.md | 4 ++-- netpkg-tool.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2d22338..84b7127 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Pre-packaged versions of *netpkg-tool* are available from the [releases tab](https://github.com/phil-harmoniq/netpkg-tool/releases): ```bash -# Github releases are tagged with their version (ex: 0.3.8) -wget https://github.com/phil-harmoniq/netpkg-tool/releases/download/0.3.8/netpkg-tool +# Github releases are tagged with their version (ex: 0.3.9) +wget https://github.com/phil-harmoniq/netpkg-tool/releases/download/0.3.9/netpkg-tool chmod a+x ./netpkg-tool # Place netpkg-tool somewhere on your $PATH (Optional) diff --git a/netpkg-tool.csproj b/netpkg-tool.csproj index 8eb84ac..05c00ec 100644 --- a/netpkg-tool.csproj +++ b/netpkg-tool.csproj @@ -7,7 +7,7 @@ Phil Hawkins Exe netcoreapp2.0 - 0.3.8 + 0.3.9 alpha Bundle .NET Core applications into convenient Linux binaries using appimagetool MIT @@ -17,7 +17,7 @@ - + From 139bd2e39fd1955e10b40624982424955a33f816 Mon Sep 17 00:00:00 2001 From: Phil H Date: Sun, 17 Sep 2017 05:53:57 -0400 Subject: [PATCH 2/8] Add contributing info --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 84b7127..f864bf2 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ public class Program Using *netpkg-tool* will restore and compile your project based on settings in your `*.csproj` file. By default, *netpkg-tool* will use [Framework Dependent Deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/#framework-dependent-deployments-fdd) to compile your project. To use [Self-Contained Deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/#self-contained-deployments-scd), use the `--scd` flag. The full process for *netpkg-tool*: 1. Restore project dependencies -2. Compile .NET Core app -3. Create AppDir and transfer files -4. Run appimagetool on created AppDir -5. Delete temporary files +1. Compile .NET Core app +1. Create AppDir and transfer files +1. Run appimagetool on created AppDir +1. Delete temporary files ## Dependencies @@ -101,6 +101,10 @@ Using *netpkg-tool* will restore and compile your project based on settings in y - [appimagetool](https://github.com/AppImage/AppImageKit): (Included) Bundles linux applications into AppImages. - [Shell.NET](https://github.com/phil-harmoniq/Shell.NET): (Included) .NET Standard library for interacting with Bash. +## Contributing + +If you have a feature request or issue, feel free to submit an [issue](https://github.com/phil-harmoniq/netpkg-tool/issues). A pull request would be even better! Pull requests should target the `develop` branch. + ## Mono While this project is mainly aimed at Microsoft's new [.NET Core](https://www.microsoft.com/net/core/) ecosystem, it should be possible to eventually make this tool work with [Mono](http://www.mono-project.com/). Mono support is planned but no exact ETA can be given until the core utility is in a more stable state. From 634a98cc9b8d2a87dc59047c2a35c4e8c172cd41 Mon Sep 17 00:00:00 2001 From: Phil H Date: Sat, 23 Sep 2017 11:09:35 -0600 Subject: [PATCH 3/8] Don't need to set .dll as executable --- file-transfer.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/file-transfer.sh b/file-transfer.sh index 72634bc..d99b11e 100755 --- a/file-transfer.sh +++ b/file-transfer.sh @@ -58,7 +58,6 @@ touch /tmp/"$APP_NAME".temp/"$APP_NAME"-icon.png # Set executable chmod a+x /tmp/"$APP_NAME".temp/AppRun -chmod u+x /tmp/"$APP_NAME".temp/usr/share/"$APP_NAME"/"$DLL_NAME".dll # Check for netpkg.lib and import libraries if [[ -d $PROJECT/netpkg.lib ]]; then From b09ae1b32d510f966b1faa9085c03589e32014a3 Mon Sep 17 00:00:00 2001 From: phil-harmoniq Date: Thu, 28 Sep 2017 23:56:27 -0400 Subject: [PATCH 4/8] Fix bash redundancy and rearrange set -e --- build.sh | 3 +-- file-transfer.sh | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index eb87d61..c01c266 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,6 @@ set -e export HERE=$(dirname "$(readlink -f "${0}")") -cd "$HERE" if [[ -z "$1" ]] || [[ ! -d "$1" ]]; then echo "You must specify a build destination folder" @@ -17,5 +16,5 @@ else mv "$HERE/squashfs-root" "$HERE/appimagetool" rm "$HERE/appimagetool.AppImage" fi - dotnet run --project "$HERE" "$HERE" "$1" + dotnet run --project "$HERE" "$HERE" "$1" fi diff --git a/file-transfer.sh b/file-transfer.sh index d99b11e..ed9f517 100755 --- a/file-transfer.sh +++ b/file-transfer.sh @@ -1,5 +1,8 @@ #! /usr/bin/env bash +# Hard exit if any part of the script fails +set -e + # Store variables from C# PROJECT="$1" DLL_NAME="$2" @@ -8,9 +11,6 @@ CORE_VERS="$4" NET_PKG="$5" MAKE_SCD="$6" -# Hard exit if any part of the script fails -set -e - # Remove old temp folder & make new one rm -rf /tmp/"$APP_NAME".temp mkdir -p /tmp/"$APP_NAME".temp/usr/share/"$APP_NAME" From c2cc280c8b1e7522fad80faf4b555a29a7badca2 Mon Sep 17 00:00:00 2001 From: Phil H Date: Tue, 3 Oct 2017 18:17:33 -0400 Subject: [PATCH 5/8] Name fixes --- Program.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Program.cs b/Program.cs index 22873ba..72fd34c 100644 --- a/Program.cs +++ b/Program.cs @@ -8,11 +8,11 @@ class Program { - static Assembly tool = Assembly.GetExecutingAssembly(); - static string ToolName = tool.GetName().Name; - static string ToolVersion = FileVersionInfo.GetVersionInfo(tool.Location).ProductVersion; + static Assembly Dll = Assembly.GetExecutingAssembly(); + static string ToolName = Dll.GetName().Name; + static string ToolVersion = FileVersionInfo.GetVersionInfo(Dll.Location).ProductVersion; static string Home = Environment.GetEnvironmentVariable("HOME"); - static string configDir = $"{Home}/.netpkg-tool"; + static string ConfigDir = $"{Home}/.netpkg-tool"; static int Width = 64; static Shell.NET.Bash Bash = new Shell.NET.Bash(); static string Csproj; @@ -179,7 +179,7 @@ static void ComileProject() Console.Write("Compiling .NET Core project..."); Bash.Command(cmd, redirect: true); } - + CheckCommandOutput(errorCode: 21); } @@ -264,8 +264,8 @@ static void HelpMenu() static void ClearLogs() { - Console.Write($"Clear log at {GetRelativePath(configDir)}/error.log"); - Bash.Rm($"{configDir}/error.log", "-f"); + Console.Write($"Clear log at {GetRelativePath(ConfigDir)}/error.log"); + Bash.Rm($"{ConfigDir}/error.log", "-f"); CheckCommandOutput(errorCode: 5); SayBye(); Environment.Exit(0); @@ -288,10 +288,10 @@ static void ExitWithError(string message, int code) static void WriteToErrorLog(string message, int code) { - if (!Directory.Exists(configDir)) - Directory.CreateDirectory(configDir); + if (!Directory.Exists(ConfigDir)) + Directory.CreateDirectory(ConfigDir); - using (var tw = new StreamWriter($"{configDir}/error.log", true)) + using (var tw = new StreamWriter($"{ConfigDir}/error.log", true)) { var now = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"); var dir = Directory.GetCurrentDirectory(); From ba3bad89c7a0c776656c10ff715a7f938376ba58 Mon Sep 17 00:00:00 2001 From: Phil H Date: Tue, 3 Oct 2017 22:03:43 -0400 Subject: [PATCH 6/8] AppImageTool now requires an architecture flag. --- Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 72fd34c..404e5ec 100644 --- a/Program.cs +++ b/Program.cs @@ -201,7 +201,7 @@ static void TransferFiles() static void RunAppImageTool() { var appimgtool = $"{Here}/appimagetool/AppRun"; - var cmd = $"{appimgtool} -n /tmp/{AppName}.temp {Destination}/{AppName}"; + var cmd = $"ARCH=x86_64 {appimgtool} -n /tmp/{AppName}.temp {Destination}/{AppName}"; if (Verbose) { From e8ecb9bf14749cc97e38fffc2de1152abd368510 Mon Sep 17 00:00:00 2001 From: Phil H Date: Tue, 3 Oct 2017 23:57:37 -0400 Subject: [PATCH 7/8] Should fall back on stable appimagetool build --- Program.cs | 2 +- build.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Program.cs b/Program.cs index 404e5ec..72fd34c 100644 --- a/Program.cs +++ b/Program.cs @@ -201,7 +201,7 @@ static void TransferFiles() static void RunAppImageTool() { var appimgtool = $"{Here}/appimagetool/AppRun"; - var cmd = $"ARCH=x86_64 {appimgtool} -n /tmp/{AppName}.temp {Destination}/{AppName}"; + var cmd = $"{appimgtool} -n /tmp/{AppName}.temp {Destination}/{AppName}"; if (Verbose) { diff --git a/build.sh b/build.sh index c01c266..a9889ad 100755 --- a/build.sh +++ b/build.sh @@ -4,16 +4,19 @@ set -e export HERE=$(dirname "$(readlink -f "${0}")") -if [[ -z "$1" ]] || [[ ! -d "$1" ]]; then +if [[ "$1" == "--clean" ]]; then + rm -r "$HERE/appimagetool" + echo "Removed $HERE/appimagetool" +elif [[ -z "$1" ]] || [[ ! -d "$1" ]]; then echo "You must specify a build destination folder" else - if [[ ! -d "$HERE/appimagetool" ]]; then + if [[ ! -f "$HERE/appimagetool/AppRun" ]]; then rm -rf "$HERE/squashfs-root" "$HERE/appimagetool.AppImage" - wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \ + wget https://github.com/AppImage/AppImageKit/releases/download/9/appimagetool-x86_64.AppImage \ -O "$HERE/appimagetool.AppImage" chmod a+x "$HERE/appimagetool.AppImage" "$HERE/appimagetool.AppImage" --appimage-extract - mv "$HERE/squashfs-root" "$HERE/appimagetool" + mv "$PWD/squashfs-root" "$HERE/appimagetool" rm "$HERE/appimagetool.AppImage" fi dotnet run --project "$HERE" "$HERE" "$1" From 595dfce42e0b2fc69b3bd4a439986d4712c8678e Mon Sep 17 00:00:00 2001 From: Phil H Date: Wed, 4 Oct 2017 00:09:41 -0400 Subject: [PATCH 8/8] State appimagetool version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f864bf2..de9515e 100644 --- a/README.md +++ b/README.md @@ -92,13 +92,13 @@ Using *netpkg-tool* will restore and compile your project based on settings in y 1. Restore project dependencies 1. Compile .NET Core app 1. Create AppDir and transfer files -1. Run appimagetool on created AppDir +1. Run *appimagetool* on created AppDir 1. Delete temporary files ## Dependencies - [.NET Core 2.0 SDK](https://www.microsoft.com/net/core/preview): Per-distro [RID](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) tags were replaced with the universal `linux-x64` [RID](https://github.com/dotnet/cli/issues/2727), simplifying the Linux build process. Earlier versions *should* work with *netpkg-tool* but only using [Framework Dependent Deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/#framework-dependent-deployments-fdd). -- [appimagetool](https://github.com/AppImage/AppImageKit): (Included) Bundles linux applications into AppImages. +- [appimagetool](https://github.com/AppImage/AppImageKit): (Included) Bundles Linux applications into AppImages, currently utilizes version 9 of *appimagetool*. - [Shell.NET](https://github.com/phil-harmoniq/Shell.NET): (Included) .NET Standard library for interacting with Bash. ## Contributing