Skip to content

Commit b5a63be

Browse files
author
Naoki Shibata
committed
Initial commit
0 parents  commit b5a63be

16 files changed

+1647
-0
lines changed

CMakeLists.txt

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
option(ENABLE_WIX "Enable generating installer with WiX" OFF)
4+
option(SUPPRESS_WIX_VALIDATION "Suppress validation in WiX" OFF)
5+
6+
set(OCTCALC_VERSION_MAJOR 0)
7+
set(OCTCALC_VERSION_MINOR 1)
8+
set(OCTCALC_VERSION_PATCHLEVEL 0)
9+
set(OCTCALC_VERSION ${OCTCALC_VERSION_MAJOR}.${OCTCALC_VERSION_MINOR}.${OCTCALC_VERSION_PATCHLEVEL})
10+
set(OCTCALC_SOVERSION ${OCTCALC_VERSION_MAJOR})
11+
12+
message(STATUS "Configuring OctCalc ${OCTCALC_VERSION_MAJOR}.${OCTCALC_VERSION_MINOR}.${OCTCALC_VERSION_PATCHLEVEL}")
13+
14+
project(octcalc LANGUAGES CXX)
15+
16+
set(CMAKE_AUTOMOC ON)
17+
set(CMAKE_AUTORCC ON)
18+
set(CMAKE_AUTOUIC ON)
19+
20+
find_package(Qt6 COMPONENTS Widgets REQUIRED HINTS "c:/opt/qt6")
21+
22+
if(WIN32 OR NOT CMAKE_BUILD_TYPE)
23+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
24+
endif()
25+
26+
string(TOLOWER "${CMAKE_BUILD_TYPE}" LC_CMAKE_BUILD_TYPE)
27+
28+
# Include submodules
29+
30+
include(ExternalProject)
31+
32+
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/submodules")
33+
file(MAKE_DIRECTORY "${PROJECT_SOURCE_DIR}/submodules")
34+
endif()
35+
36+
set(TLFLOAT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/submodules/src/tlfloat")
37+
38+
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/submodules/tlfloat/include")
39+
file(MAKE_DIRECTORY "${PROJECT_SOURCE_DIR}/submodules/tlfloat")
40+
file(MAKE_DIRECTORY "${PROJECT_SOURCE_DIR}/submodules/tlfloat/include")
41+
file(MAKE_DIRECTORY "${PROJECT_SOURCE_DIR}/submodules/tlfloat/lib")
42+
43+
set(ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_SOURCE_DIR}/submodules/tlfloat -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_TESTS=False)
44+
45+
if (CMAKE_C_COMPILER)
46+
set(ARGS ${ARGS} -DCMAKE_C_COMPILER:PATH=${CMAKE_C_COMPILER})
47+
endif()
48+
49+
if (CMAKE_CXX_COMPILER)
50+
set(ARGS ${ARGS} -DCMAKE_CXX_COMPILER:PATH=${CMAKE_CXX_COMPILER})
51+
endif()
52+
53+
if (TLFLOAT_SOURCE_DIR)
54+
ExternalProject_Add(ext_tlfloat
55+
SOURCE_DIR "${TLFLOAT_SOURCE_DIR}"
56+
CMAKE_ARGS ${ARGS}
57+
)
58+
else()
59+
find_package(Git REQUIRED)
60+
ExternalProject_Add(ext_tlfloat
61+
GIT_REPOSITORY https://github.com/shibatch/tlfloat
62+
GIT_TAG 3ce0fcbb7c32565cf7553cbddd1db2fc03fa4534
63+
SOURCE_DIR "${TLFLOAT_SOURCE_DIR}"
64+
CMAKE_ARGS ${ARGS}
65+
)
66+
endif()
67+
else()
68+
add_custom_target(ext_tlfloat ALL)
69+
endif()
70+
71+
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/submodules/tlfloat/include")
72+
link_directories("${PROJECT_SOURCE_DIR}/submodules/tlfloat/lib")
73+
74+
# Setup WIX
75+
76+
if (WIN32 AND ENABLE_WIX)
77+
set(CPACK_PACKAGE_NAME "OctCalc")
78+
set(CPACK_PACKAGE_VENDOR "Naoki Shibata")
79+
set(CPACK_PACKAGE_DESCRIPTION "Octuple precision calculator")
80+
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/shibatch/octcalc")
81+
set(CPACK_WIX_PROPERTY_ARPCOMMENTS "OctCalc")
82+
set(CPACK_WIX_PROPERTY_ARPHELPLINK "https://github.com/shibatch/octcalc")
83+
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://github.com/shibatch/octcalc")
84+
85+
set(CPACK_WIX_UPGRADE_GUID "5f89bb9b-edb8-4ca3-9e6c-27df3858054c")
86+
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt)
87+
set(CPACK_PACKAGE_NAME "OctCalc")
88+
set(CPACK_PACKAGE_VERSION "${OCTCALC_VERSION}")
89+
set(CPACK_WIX_PROGRAM_MENU_FOLDER "OctCalc")
90+
91+
SET(CMAKE_INSTALL_PREFIX "C:/Program Files/OctCalc" CACHE PATH "Install path" FORCE)
92+
SET(CPACK_SET_DESTDIR FALSE)
93+
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "OctCalc")
94+
SET(CPACK_PACKAGING_INSTALL_PREFIX "")
95+
96+
if (SUPPRESS_WIX_VALIDATION)
97+
list(APPEND CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval")
98+
endif()
99+
100+
#
101+
102+
find_program(WINDEPLOYQT_EXECUTABLE windeployqt)
103+
104+
#
105+
106+
set(INSTALL_PREFIX "")
107+
set(CPACK_GENERATOR WIX)
108+
include(CPack)
109+
else()
110+
set(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
111+
endif()
112+
113+
set(INSTALL_BINDIR "${INSTALL_PREFIX}bin")
114+
115+
add_compile_definitions(OCTCALC_VERSION_MAJOR=${OCTCALC_VERSION_MAJOR})
116+
add_compile_definitions(OCTCALC_VERSION_MINOR=${OCTCALC_VERSION_MINOR})
117+
add_compile_definitions(OCTCALC_VERSION_PATCHLEVEL=${OCTCALC_VERSION_PATCHLEVEL})
118+
119+
add_subdirectory("src")
120+
121+
message(STATUS "CMAKE_BUILD_TYPE : " ${CMAKE_BUILD_TYPE})

CODE_OF_CONDUCT.md

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
2+
# Community guidelines to ensure fair rewards for OSS projects
3+
4+
Version 0.7, 2024-07-07
5+
6+
Copyright Naoki Shibata 2024. https://github.com/shibatch/nofreelunch
7+
8+
This document is licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
9+
10+
11+
## Preface
12+
13+
In OSS projects, software needs to be maintained continuously, and
14+
this requires a continuous effort to be devoted to the
15+
maintenance. However, OSS developers have little or no financial
16+
incentive to continue maintenance and development. As a result, OSS
17+
developers stop maintaining their projects much sooner than users
18+
expect, often abruptly. This problem is called the OSS developer
19+
"burnout" problem.
20+
21+
The "burnout" of OSS developers is a frequently discussed topic, but
22+
the real problem is that companies that use OSS commercially do not
23+
financially support open source projects. Development and maintenance
24+
of OSS cannot proceed unless someone contributes resources, and the
25+
role of providing resources free of charge should not be imposed on
26+
those who have been developing OSS. Also, by the time each prominent
27+
OSS has achieved usable performance by commercial standards, the
28+
developers or their employers have had to bear the development
29+
resources. Even if a company does not expect continuous maintenance of
30+
OSS, it should be natural that a company that uses OSS commercially
31+
bear a part of the development resources up to that point.
32+
33+
Let me explain in simpler language. Imagine that you are offered a
34+
free lunch somewhere. In such a case, a rather large number of people
35+
would say, "Who is covering the cost of this lunch? Let me bear the
36+
cost of what I eat." But when it comes to using OSS, the number of
37+
such people is much smaller. And then there are those who sell what is
38+
provided free of charge to others at a price. Certainly, as a free
39+
lunch provider, I don't forbid that, but isn't that making too much
40+
use of the generosity? And when I stop offering free lunch, people say
41+
I have "burned out." Is it appropriate to call it a "burnout" when the
42+
resources to provide free lunch have been exhausted? If those who are
43+
making a profit give some of it back, then I can continue to offer
44+
free lunches. I think everyone would be happier that way, don't you?
45+
This is what I mean.
46+
47+
Unlike receiving a free lunch that has substance, downloading software
48+
may seem like less of an incentive to pay a fee because you cannot see
49+
the face of the developer and the software is only information and not
50+
substance. However, there are real people involved in the development
51+
and maintenance of the software, and real resources are committed for
52+
this purpose.
53+
54+
Some may argue that if that is the case, then I should just make the
55+
license noncommercial. However, if I prohibit commercial use, even if
56+
conditionally, adopting the software will require complex
57+
deliberations within the company. If the company is required to pay a
58+
certain percentage of the profits earned, the paperwork for this would
59+
become cumbersome, and it would also be necessary to publish the
60+
figures on which the payment is based. A large part of these
61+
deliberations is devoted to whether and how the software can be used
62+
free of charge. Companies are, after all, profit maximizing
63+
organizations, and the conclusion tends to be that what can be used
64+
for free is used for free to the maximum extent possible, while
65+
software that is not free for commercial use is not used much. There
66+
used to be many free-of-charge software products that prohibited
67+
commercial use, but many of them were not used much and eventually
68+
abandoned. This is, in a sense, the tragedy of the commons, and
69+
capitalism cannot optimize the use of OSS. A license that prohibits
70+
commercial use does not solve the problem either.
71+
72+
It is undeniable that OSS and free software have become popular
73+
because they can be used free of charge. But, if it says that
74+
receiving a free service does not obligate you to do anything, is it
75+
really appropriate to do absolutely nothing after receiving the free
76+
service? If something is offered free of charge as a favor, it would
77+
be better to pay for it in some cases, even if it is clearly marked
78+
free of charge. In some cases, companies are making huge profits by
79+
using OSS and free software. Isn't it strange that it is normal not to
80+
pay for the use of OSS and free software at all even in such cases?
81+
And the amount needed by OSS developers should be small enough
82+
compared to what those companies usually spend on other
83+
deals. Curiously, there seems to be a tendency to understate labor
84+
costs that have already been agreed to be paid and to overstate new
85+
costs that will be incurred and paid externally.
86+
87+
The problem of developer "burnout" becomes a problem because there is
88+
still commercial value in the software. If the software has no value
89+
anymore, it would not be called "burnout." In such a case, the project
90+
simply "fades away" without anyone noticing. Would you continue to
91+
work if no one pays you for the work you do even though there is a
92+
demand for your work? You would quit, wouldn't you? That is not
93+
usually called "burnout." It is not nice to talk about a user's
94+
problem as if it were the developer's problem.
95+
96+
Therefore, I believe that social benefit can be maximized by nominally
97+
allowing companies to use software free of charge for commercial use,
98+
but still increasing awareness that a portion of the profits should be
99+
returned to the project as a matter of morality. And I expect
100+
companies to create and follow such a code of conduct.
101+
102+
Don't worry. You and companies will not be banned from this project
103+
for violation.
104+
105+
106+
## Positioning and purpose of these guidelines
107+
108+
These guidelines summarize the standards of practice that the
109+
participating members of the project are expected to follow in order
110+
to facilitate the promotion and operation of the project. These
111+
guidelines are not a set of rules, and no penalties or other
112+
consequences for violations are set forth in this guideline. Each
113+
member may completely disregard these guidelines if he/she wishes. To
114+
explain a little more for those who still feel uneasy about this, we
115+
recognize that if you are only using the products of this project, it
116+
does not mean that you are participating in the community, and you do
117+
not need to concern yourself with these community guidelines at all.
118+
In addition, there is no provision in the software distribution
119+
license that prohibits removal of these guidelines in derivative
120+
projects.
121+
122+
The primary purpose of establishing these guidelines is to encourage
123+
companies that make commercial use of OSS or free software to create
124+
and adhere to the following code of conduct : if a company is making
125+
commercial use of OSS or free software, such as bundling it with their
126+
products for sale, they should provide continuous financial support
127+
for the project while the commercial use continues. The members of
128+
this project are asked to help raise awareness to make this happen. In
129+
particular, if you participate in this project as a member of a
130+
company that makes commercial use of this software, we would greatly
131+
appreciate your understanding of the purpose of these guidelines.
132+
133+
The second purpose is to prevent conflicts among the members. Although
134+
this project is a software development project, political discussions
135+
may be sometimes required to keep the project moving forward. Some of
136+
the guidelines summarize the items that each member is expected to
137+
follow in order to avoid conflicts among members and to promote calm
138+
and smooth discussions.
139+
140+
141+
## The guidelines
142+
143+
### Striving to change perceptions about the commercial use of OSS and free software
144+
145+
* Project members strive to promote the awareness that commercial use
146+
of open source or free software for free without any contribution is
147+
free-riding and should be avoided whenever possible.
148+
149+
* Project members strive to promote the awareness that it is natural
150+
for companies and other organization that make a profit from the
151+
commercial use of open source or free software to return a portion
152+
of the profit to the relevant projects as long as the commercial use
153+
continues.
154+
155+
* Project members strive to promote the awareness that it is natural
156+
for companies and other organizations that use open source or free
157+
software to contribute to relevant projects, and the organizations
158+
should give high recognition to their members who contribute to open
159+
source or free software projects on the job.
160+
161+
* Project members strive to promote that if a company agrees with the
162+
intent of these guidelines, it should post a notice so that it can
163+
be recognized by the general public.
164+
165+
166+
### Compliance with laws
167+
168+
* Each member should comply with the laws of his/her own place of
169+
residence.
170+
* Each member should abide by laws of his/her own place of residence
171+
even if the laws do not have penal provisions.
172+
173+
* Each member should not follow any request of anti-social groups or
174+
cults.
175+
* The terms "antisocial organization" and "cult" herein refer to
176+
organizations officially recognized as such in each member's place
177+
of residence. The same applies hereinafter.
178+
179+
180+
### Keeping calm and logical discussion
181+
182+
* Each member should refrain from posting a comment that is considered
183+
likely to cause strong emotions in those who read the comment.
184+
185+
* Each member should refrain from posting a comment that is not in
186+
line with the project's objectives.
187+
188+
* Each member of the project should not change the way he/she treats
189+
another member for any of the following reasons.
190+
* Discriminatory reasons (attributes that were determined at the
191+
time of the person's birth and cannot be changed)
192+
* Ideology or beliefs that are not relevant to the purpose of the
193+
project
194+
* Whether or not each participant belongs to an antisocial group
195+
or cult is always regarded as relevant to the purpose of the
196+
project. The project may ban a participant who is found to be a
197+
member of an anti-social organization or cult for the sole
198+
reason of his/her membership in such an organization.
199+
* Inequalities that existed in the past
200+
201+
* Each member of the project should treat another member equally at
202+
the time the action is taken.
203+
* In principle, affirmative action is not supported in this project.
204+
Imposing disadvantages on members who do not support affirmative
205+
action is production of new inequalities and should be avoided. If
206+
affirmative action must be taken, the disadvantage for it should
207+
be borne entirely by the supporters of affirmative action.
208+
209+
210+
### To resolve the problem throughout the community
211+
212+
* Each member of the project should listen sincerely to the claims of
213+
other members that there have been violations of the above items and
214+
cooperates in resolving the problem.
215+
216+
* Project members should not leave it up to the project maintainers to
217+
resolve the problems.
218+
* The relationship between the maintainers and the other members is
219+
not that of parents and children. The mainteners only have the
220+
privileges of the websites related to the project and basically
221+
what you cannot do is not possible for the maintainers either.
222+

LICENSE.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Boost Software License - Version 1.0 - August 17th, 2003
2+
3+
Permission is hereby granted, free of charge, to any person or organization
4+
obtaining a copy of the software and accompanying documentation covered by
5+
this license (the "Software") to use, reproduce, display, distribute,
6+
execute, and transmit the Software, and to prepare derivative works of the
7+
Software, and to permit third-parties to whom the Software is furnished to
8+
do so, all subject to the following:
9+
10+
The copyright notices in the Software and this entire statement, including
11+
the above license grant, this restriction and the following disclaimer,
12+
must be included in all copies of the Software, in whole or in part, and
13+
all derivative works of the Software, unless such copies or derivative
14+
works are solely in the form of machine-executable object code generated by
15+
a source language processor.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
20+
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21+
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
22+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23+
DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)