Skip to content

Commit 350f147

Browse files
authored
Merge pull request #28 from jaydg/organisation
Improve dub file and build examples with dub
2 parents 629933c + c16c95e commit 350f147

File tree

52 files changed

+427
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+427
-95
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
examples/bin
2-
examples/bin/*
1+
examples/*/bin
32

43
*.o
54
*.so
65
*.a
6+
.dub

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
before_install:
2-
- sudo curl http://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -o /etc/apt/sources.list.d/d-apt.list
3-
- sudo apt-get update && sudo apt-get -y --allow-unauthenticated install d-apt-keyring && sudo apt-get update
4-
- sudo apt-get install dmd-bin libncursesw5 make
1+
language: d
52

6-
script:
7-
dmd -lib -L-lncursesw -oflibncurses-d deimos/ncurses/curses.d deimos/ncurses/eti.d deimos/ncurses/form.d deimos/ncurses/menu.d deimos/ncurses/ncurses.d deimos/ncurses/panel.d deimos/ncurses/unctrl.d
3+
d:
4+
- dmd
5+
- ldc
6+
- gdc
87

9-
cd examples/ && make
8+
script:
9+
- dub build
10+
- dub build -c panels
11+
- dub build -c full
12+
- |
13+
for E in examples/*/dub.json ; do
14+
EXAMPLE="$(dirname ${E#*/})"
15+
dub build "ncurses:$EXAMPLE"
16+
done

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Ncurses
1+
Ncurses
22
=======
3-
[![Build Status](https://travis-ci.org/1100110/ncurses.png?branch=master)](https://travis-ci.org/1100110/ncurses)
3+
[![Build Status](https://travis-ci.org/D-Programming-Deimos/ncurses.svg?branch=master)](https://travis-ci.org/D-Programming-Deimos/ncurses)
44

55

66
This is currently in BETA.
@@ -9,6 +9,25 @@ There will be bugs. C Macros are missing, enums are slightly renamed.
99
If you have any trouble, or think that something should be fixed,
1010
then please create a bug report.
1111

12+
Variants of this package
13+
------------------------
14+
15+
This package can be build in three variants:
16+
17+
* **minimal**: The minimal (which is the default configuration) configurations only links the ncursesw library.
18+
19+
* **panels**: The panels configuration additionally links the panelw library.
20+
21+
* **full**: The full configuration additionally links the formw and menuw library.
22+
23+
To use a specific configuration in your projects, depend on this package by adding the following config snippet to your project's dub.json:
24+
25+
```
26+
"subConfigurations": {
27+
"ncurses": "full"
28+
}
29+
```
30+
1231
WARNINGS & PRECAUTIONS
1332
----------------------
1433
What files make up the 'official' ncurses package?

examples/Makefile

Lines changed: 0 additions & 65 deletions
This file was deleted.

examples/README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ Here are a few examples to get you started.
55
The main site where these examples were originally found is here [tldp.org](http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/)
66
These examples need some work, but they should demonstrate that most everything is in working order.
77

8-
All of the files *should* be executable and set to link with ncursesw by default.
9-
If you have rdmd installed in /usr/bin/rdmd, then ./helloWorld.d should get you going!
10-
11-
if not, then make [filename], and the programs will be in ./bin/
8+
To run the examples, change to the specific directory and build and execute the example with "dub run".
129

1310
### Requirements:
1411
- [rdmd](http://github.com/D-Programming-Language/tools)
1512
- ncursesw
1613

17-
### Files
18-
- helloWorld.d - a simple hello world example.
19-
- helloUnicode.d - a simple unicode example.
20-
- keyCode.d - returns the number code of the key you pressed.
21-
- simpleColor.d - a simple example that demonstrates color output.
14+
### Examples
15+
- helloWorld - a simple hello world example.
16+
- helloUnicode - a simple unicode example.
17+
- keyCode - returns the number code of the key you pressed.
18+
- simpleColor - a simple example that demonstrates color output.
2219

2320
### TODO
2421
[ ] review, and fix anything that's broken.
@@ -27,5 +24,5 @@ if not, then make [filename], and the programs will be in ./bin/
2724
[ ] fix so that examples are compilable on Windows.
2825

2926
Again, please file any bugs that you come across.
30-
Even if you don't know if it is actually a bug, we appreciate the time.
27+
Even if you don't know if it is actually a bug, we appreciate the time.
3128
We understand that sometimes it is hard to figure out.

examples/acsvars/dub.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "acsvars",
3+
"description": "Example application for the D ncurses library",
4+
"homepage": "https://github.com/D-Programming-Deimos/ncurses",
5+
"authors": [
6+
"Jon \"ylixir\" Allen",
7+
"Dejan Lekic",
8+
"Jude \"1100110\" Young"
9+
],
10+
"license": "ncurses",
11+
"dependencies": {
12+
"ncurses": "*"
13+
},
14+
"targetPath": "bin",
15+
"targetType": "executable",
16+
"targetName": "acsVars"
17+
}
File renamed without changes.

examples/attribmenu/dub.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "attribmenu",
3+
"description": "Example application for the D ncurses library",
4+
"homepage": "https://github.com/D-Programming-Deimos/ncurses",
5+
"authors": [
6+
"Jon \"ylixir\" Allen",
7+
"Dejan Lekic",
8+
"Jude \"1100110\" Young"
9+
],
10+
"license": "ncurses",
11+
"dependencies": {
12+
"ncurses": "*"
13+
},
14+
"subConfigurations": {
15+
"ncurses": "full"
16+
},
17+
"targetPath": "bin",
18+
"targetType": "executable",
19+
"targetName": "attribMenu"
20+
}
File renamed without changes.

examples/chgat/dub.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "chgat",
3+
"description": "Example application for the D ncurses library",
4+
"homepage": "https://github.com/D-Programming-Deimos/ncurses",
5+
"authors": [
6+
"Jon \"ylixir\" Allen",
7+
"Dejan Lekic",
8+
"Jude \"1100110\" Young"
9+
],
10+
"license": "ncurses",
11+
"dependencies": {
12+
"ncurses": "*"
13+
},
14+
"targetPath": "bin",
15+
"targetType": "executable",
16+
"targetName": "chgat"
17+
}

0 commit comments

Comments
 (0)