Skip to content

Commit

Permalink
Add support for D language
Browse files Browse the repository at this point in the history
  • Loading branch information
zopieux committed Feb 10, 2018
1 parent 3ed5966 commit f4f6c08
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .travis/install.sh
Expand Up @@ -24,6 +24,11 @@ sudo apt-get install -qq -y \
ruby \
rustc

# dlang
wget -O /tmp/dmd_2.078.2-0_amd64.deb http://downloads.dlang.org/releases/2.x/2.078.2/dmd_2.078.2-0_amd64.deb
sudo dpkg -i /tmp/dmd_2.078.2-0_amd64.deb
dmd --version | head -1

# update-alternatives nonsense to force gcc-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100
Expand Down
1 change: 1 addition & 0 deletions camisole/languages/__init__.py
Expand Up @@ -39,6 +39,7 @@ def load_from_environ():
__all__ = [
'ada',
'c',
'd',
'csharp',
'cxx',
'haskell',
Expand Down
18 changes: 18 additions & 0 deletions camisole/languages/d.py
@@ -0,0 +1,18 @@
from camisole.models import Lang, Program


class D(Lang):
source_ext = '.d'
compiler = Program('dmd')
allowed_dirs = ['/etc']
reference_source = r'''
void main()
{
import std.stdio: writeln;
writeln("42");
}
'''

def compile_opt_out(self, output):
# '-of' and its value as two distinct arguments is illegal (go figure)
return ['-of' + output]
12 changes: 10 additions & 2 deletions doc/changelog.rst
@@ -1,8 +1,16 @@
Changelog
=========

1.0.0
*****
1.1
***

New features
------------

* Add support for the D language.

1.0
***

Breaking changes
----------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -6,7 +6,7 @@

setup(
name='camisole',
version='1.0',
version='1.1',
packages=find_packages(),
url='https://github.com/prologin/camisole',
license='GPL',
Expand Down

0 comments on commit f4f6c08

Please sign in to comment.