Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions Naggum.Compiler/Naggum.Compiler.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="Globals.fs" />
<Compile Include="Reader.fs" />
Expand Down Expand Up @@ -94,11 +94,11 @@
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
10 changes: 5 additions & 5 deletions Naggum.Test/Naggum.Test.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Content Include="Naggum.Test.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down Expand Up @@ -94,11 +94,11 @@
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
8 changes: 8 additions & 0 deletions Naggum.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ 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
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

Expand Down
72 changes: 72 additions & 0 deletions docs/Build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Naggum Build Guide
==================

Windows
-------

To build Naggum on 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 the
Naggum source directory.

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 distributions.

### NixOS Linux

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 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 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 have 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

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

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=$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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a review, but just a note of admiration: that's a cool trick! That's a very nice way to copy things into multiple directories.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found it here :)


After that, you can run Naggum.Compiler, for example:

$ cd Naggum.Compiler/bin/Release/
$ mono Naggum.Compiler.exe ../../../tests/test.naggum
$ mono test.exe

[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