From 53d685920ecc84f2de70d53f034acfa708468107 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Mon, 4 Jan 2016 12:17:16 +0600 Subject: [PATCH 1/6] Project: fix FSharpTargetsPath-related issues. Now it could be passed as an environment variable, which is useful e.g for NixOS build. --- Naggum.Compiler/Naggum.Compiler.fsproj | 10 +++++----- Naggum.Test/Naggum.Test.fsproj | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Naggum.Compiler/Naggum.Compiler.fsproj b/Naggum.Compiler/Naggum.Compiler.fsproj index acbed1c..ffdbae4 100644 --- a/Naggum.Compiler/Naggum.Compiler.fsproj +++ b/Naggum.Compiler/Naggum.Compiler.fsproj @@ -42,17 +42,17 @@ - + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - + @@ -94,11 +94,11 @@ True - - \ No newline at end of file + diff --git a/Naggum.Test/Naggum.Test.fsproj b/Naggum.Test/Naggum.Test.fsproj index 2079617..abe97f7 100644 --- a/Naggum.Test/Naggum.Test.fsproj +++ b/Naggum.Test/Naggum.Test.fsproj @@ -36,17 +36,17 @@ - + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - + PreserveNewest @@ -94,11 +94,11 @@ True - - \ No newline at end of file + From 077e934a3af81bae7370977df0f4f22c85a01b37 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Mon, 4 Jan 2016 12:17:34 +0600 Subject: [PATCH 2/6] Docs: add build guide. --- docs/Build.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/Build.md diff --git a/docs/Build.md b/docs/Build.md new file mode 100644 index 0000000..c6a5121 --- /dev/null +++ b/docs/Build.md @@ -0,0 +1,54 @@ +Naggum Build Guide +================== + +Windows +------- + +To build Naggum under Windows, just use Visual Studio or MSBuild like that: + + $ cd naggum + $ nuget restore + $ msbuild /p:Configuration=Release Naggum.sln + +Linux +----- + +See general build instructions for Linux in the file `.travis.yml` inside of the +Naggum root source directory. + +You'll need [Mono][mono], [NuGet][nuget] and [F# Compiler][fsharp] installed in +you current environment. Some of them may or may not be part of your Mono +installation; just make sure you have them all properly installed. + +Below is an example of setting up these tools on [NixOS Linux][nixos]; feel free +to add instructions for any other non-standard distributives. + +### NixOS Linux + +First of all, install `mono` and `fsharp` packages to your environment: + + $ nix-env -i mono fsharp + +According to the recommendations in +[`patch-fsharp-targets`][patch-fsharp-targets] build helpers, you may want to +set up the environment variable `FSharpTargetsPath` either globally or locally: + + $ export FSharpTargetsPath=$(dirname $(which fsharpc))/../lib/mono/4.5/Microsoft.FSharp.Targets + +You'll need a NuGet executable. Unfortunately, there is no NixOS package for +NuGet, so you need to download it manually: + + $ cd naggum + $ wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + +After that you can download the dependencies and build the project using +`xbuild`: + + $ mono nuget.exe restore Naggum.sln + $ xbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" Naggum.sln + +[fsharp]: http://fsharp.org/ +[mono]: http://www.mono-project.com/ +[nixos]: http://nixos.org/ +[nuget]: http://www.nuget.org/ +[patch-fsharp-targets]: https://github.com/NixOS/nixpkgs/blob/d4681bf62672083f92545e02e00b8cf040247e8d/pkgs/build-support/dotnetbuildhelpers/patch-fsharp-targets.sh From 0b9848d4747e36596090b62d0dd5bb05b5369999 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Mon, 4 Jan 2016 21:52:27 +0600 Subject: [PATCH 3/6] Solution: add build documentation. --- Naggum.sln | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Naggum.sln b/Naggum.sln index 5f7a6d4..7466020 100644 --- a/Naggum.sln +++ b/Naggum.sln @@ -33,6 +33,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Naggum.Assembler", "Naggum.Assembler\Naggum.Assembler.fsproj", "{40B84F1E-1823-4255-80D4-1297613025C1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{AFA24DE4-7328-448D-B0BE-1ABF4812B315}" + ProjectSection(SolutionItems) = preProject + docs\Build.md = docs\Build.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -63,4 +68,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AFA24DE4-7328-448D-B0BE-1ABF4812B315} = {F85A1ACB-4A60-46A9-856D-92A3C9B97402} + EndGlobalSection EndGlobal From 5651685c58177d05b9a58964cad17b3b55bc8f87 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Mon, 4 Jan 2016 21:53:10 +0600 Subject: [PATCH 4/6] Build documentation: improve NixOS build instructions. --- docs/Build.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/Build.md b/docs/Build.md index c6a5121..8c18073 100644 --- a/docs/Build.md +++ b/docs/Build.md @@ -29,6 +29,10 @@ First of all, install `mono` and `fsharp` packages to your environment: $ nix-env -i mono fsharp +Please note that you need `fsharp` >= 4.0 to build Naggum, which is currently on +unstable NixOS channel. So maybe you'll need to switch to the unstable channel +or build `fsharp` from [Nixpkgs][nixpkgs] source. + According to the recommendations in [`patch-fsharp-targets`][patch-fsharp-targets] build helpers, you may want to set up the environment variable `FSharpTargetsPath` either globally or locally: @@ -38,6 +42,7 @@ set up the environment variable `FSharpTargetsPath` either globally or locally: You'll need a NuGet executable. Unfortunately, there is no NixOS package for NuGet, so you need to download it manually: + $ nix-env -i wget # if not installed already $ cd naggum $ wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe @@ -47,8 +52,21 @@ After that you can download the dependencies and build the project using $ mono nuget.exe restore Naggum.sln $ xbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" Naggum.sln +After that you should copy `FSharp.Core.dll` to the project output directory, +because currently Nix have problems with concept of Mono global assembly cache: + + $ FSHARP_CORE=~/.nix-profile/lib/mono/Reference\ Assemblies/Microsoft/FSharp/.NETFramework/v4.0/4.4.0.0/FSharp.Core.dll + $ echo Naggum.*/bin/Release | xargs -n 1 cp -f "$FSHARP_CORE" + +After that, you can run Naggum.Compiler, for example: + + $ cd Naggum.Compiler/bin/Release/ + $ mono Naggum.Compiler.exe ../../../tests/test.naggum + $ mono test.naggum + [fsharp]: http://fsharp.org/ [mono]: http://www.mono-project.com/ [nixos]: http://nixos.org/ +[nixpkgs]: https://github.com/NixOS/nixpkgs [nuget]: http://www.nuget.org/ [patch-fsharp-targets]: https://github.com/NixOS/nixpkgs/blob/d4681bf62672083f92545e02e00b8cf040247e8d/pkgs/build-support/dotnetbuildhelpers/patch-fsharp-targets.sh From 2ff7d9aebf40d5121b004264b73bf4d82e3b3e98 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Mon, 4 Jan 2016 21:57:50 +0600 Subject: [PATCH 5/6] Readme: add a link to the build instructions. --- Readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Readme.md b/Readme.md index 335da4e..ed8d0b3 100644 --- a/Readme.md +++ b/Readme.md @@ -9,6 +9,11 @@ Naggum does not aim to be yet another Common Lisp or Scheme or Emacs Lisp or whatever implementation. Instead, we are trying to deliver a modern Lisp dialect that makes use of most of .Net's benefits. +## Build + +To build the project under various environments, see [build +instructions][build-instructions]. + ## License Naggum is licensed under the terms of MIT License. See License.md file for @@ -16,6 +21,7 @@ details. [andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier [appveyor]: https://ci.appveyor.com/project/ForNeVeR/naggum/branch/develop +[build-instructions]: docs/Build.md [eric-naggum]: https://en.wikipedia.org/wiki/Erik_Naggum [travis]: https://travis-ci.org/codingteam/naggum From 56e32e2ad192cb963735ae34aca4d62865bbff5b Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Tue, 5 Jan 2016 13:21:58 +0600 Subject: [PATCH 6/6] Build guide: changes after review. --- docs/Build.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/Build.md b/docs/Build.md index 8c18073..3d21bdc 100644 --- a/docs/Build.md +++ b/docs/Build.md @@ -4,7 +4,7 @@ Naggum Build Guide Windows ------- -To build Naggum under Windows, just use Visual Studio or MSBuild like that: +To build Naggum on Windows, just use Visual Studio or MSBuild like that: $ cd naggum $ nuget restore @@ -13,15 +13,15 @@ To build Naggum under Windows, just use Visual Studio or MSBuild like that: Linux ----- -See general build instructions for Linux in the file `.travis.yml` inside of the -Naggum root source directory. +See general build instructions for Linux in the file `.travis.yml` inside the +Naggum source directory. -You'll need [Mono][mono], [NuGet][nuget] and [F# Compiler][fsharp] installed in -you current environment. Some of them may or may not be part of your Mono -installation; just make sure you have them all properly installed. +You'll need [Mono][mono], [NuGet][nuget] and [F# Compiler][fsharp] installed. +Some of them may or may not be part of your Mono installation; just make sure +you've got them all. Below is an example of setting up these tools on [NixOS Linux][nixos]; feel free -to add instructions for any other non-standard distributives. +to add instructions for any other distributions. ### NixOS Linux @@ -29,18 +29,18 @@ First of all, install `mono` and `fsharp` packages to your environment: $ nix-env -i mono fsharp -Please note that you need `fsharp` >= 4.0 to build Naggum, which is currently on -unstable NixOS channel. So maybe you'll need to switch to the unstable channel -or build `fsharp` from [Nixpkgs][nixpkgs] source. +Please note that you need `fsharp` >= 4.0 to build Naggum, which is currently in +the unstable channel. So maybe you'll need to switch to the unstable channel or +build `fsharp` from [Nixpkgs][nixpkgs] source. According to the recommendations in -[`patch-fsharp-targets`][patch-fsharp-targets] build helpers, you may want to -set up the environment variable `FSharpTargetsPath` either globally or locally: +[`patch-fsharp-targets`][patch-fsharp-targets] build helper, you may want to set +up the environment variable `FSharpTargetsPath` either globally or locally: $ export FSharpTargetsPath=$(dirname $(which fsharpc))/../lib/mono/4.5/Microsoft.FSharp.Targets You'll need a NuGet executable. Unfortunately, there is no NixOS package for -NuGet, so you need to download it manually: +NuGet, so you have to download it manually: $ nix-env -i wget # if not installed already $ cd naggum @@ -55,14 +55,14 @@ After that you can download the dependencies and build the project using After that you should copy `FSharp.Core.dll` to the project output directory, because currently Nix have problems with concept of Mono global assembly cache: - $ FSHARP_CORE=~/.nix-profile/lib/mono/Reference\ Assemblies/Microsoft/FSharp/.NETFramework/v4.0/4.4.0.0/FSharp.Core.dll + $ FSHARP_CORE=$HOME/.nix-profile/lib/mono/Reference\ Assemblies/Microsoft/FSharp/.NETFramework/v4.0/4.4.0.0/FSharp.Core.dll $ echo Naggum.*/bin/Release | xargs -n 1 cp -f "$FSHARP_CORE" After that, you can run Naggum.Compiler, for example: $ cd Naggum.Compiler/bin/Release/ $ mono Naggum.Compiler.exe ../../../tests/test.naggum - $ mono test.naggum + $ mono test.exe [fsharp]: http://fsharp.org/ [mono]: http://www.mono-project.com/